From 58d0cc17d87e42e238fb5e453d51d8f3025a1b6d Mon Sep 17 00:00:00 2001 From: Jacek Migdal Date: Wed, 13 Nov 2024 02:32:23 -0700 Subject: [PATCH] Remove dotted compensation (#980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Less sure, @nablaone should look. Produce tons of warnings, does not do anything. Dead code. Co-authored-by: Rafał Strzaliński --- quesma/quesma/schema_transformer.go | 31 ----------------------------- 1 file changed, 31 deletions(-) diff --git a/quesma/quesma/schema_transformer.go b/quesma/quesma/schema_transformer.go index 5b44e69b6..698ea1d22 100644 --- a/quesma/quesma/schema_transformer.go +++ b/quesma/quesma/schema_transformer.go @@ -10,7 +10,6 @@ import ( "quesma/model/typical_queries" "quesma/quesma/config" "quesma/schema" - "quesma/util" "sort" "strings" ) @@ -630,35 +629,6 @@ func (s *SchemaCheckPass) applyTimestampField(indexSchema schema.Schema, query * } -func (s *SchemaCheckPass) handleDottedTColumnNames(indexSchema schema.Schema, query *model.Query) (*model.Query, error) { - - // TODO this is a workaround for now, - // if we set true dashboards are working but not tests - doCompensation := false - - visitor := model.NewBaseVisitor() - - visitor.OverrideVisitColumnRef = func(b *model.BaseExprVisitor, e model.ColumnRef) interface{} { - - if strings.Contains(e.ColumnName, ".") { - logger.Warn().Msgf("Dotted column name found: %s", e.ColumnName) - - if doCompensation { - return model.NewColumnRef(util.FieldToColumnEncoder(e.ColumnName)) - } - - } - return e - } - - expr := query.SelectCommand.Accept(visitor) - - if _, ok := expr.(*model.SelectCommand); ok { - query.SelectCommand = *expr.(*model.SelectCommand) - } - return query, nil -} - func (s *SchemaCheckPass) applyFieldEncoding(indexSchema schema.Schema, query *model.Query) (*model.Query, error) { visitor := model.NewBaseVisitor() @@ -784,7 +754,6 @@ func (s *SchemaCheckPass) Transform(queries []*model.Query) ([]*model.Query, err // Section 4: compensations and checks {TransformationName: "BooleanLiteralTransformation", Transformation: s.applyBooleanLiteralLowering}, - {TransformationName: "DottedColumnNames", Transformation: s.handleDottedTColumnNames}, } for k, query := range queries {