diff --git a/quesma/model/expr_string_renderer.go b/quesma/model/expr_string_renderer.go index cc9f57e89..0f9ca90fa 100644 --- a/quesma/model/expr_string_renderer.go +++ b/quesma/model/expr_string_renderer.go @@ -3,7 +3,6 @@ package model import ( - "context" "fmt" "quesma/logger" "quesma/quesma/types" @@ -77,12 +76,12 @@ func (v *renderer) VisitTuple(t TupleExpr) interface{} { } switch len(exprs) { case 0: - logger.WarnWithCtxAndThrottling(context.Background(), "visit", "tuple", "tuple with 0 length") // hacky way to log this + logger.WarnWithThrottling("visitTuple", "tupleExpr with no expressions") // hacky way to log this return "tuple()" case 1: - return exprs[0] + return t.Exprs[0] default: - return fmt.Sprintf("tuple(%s)", strings.Join(exprs, ", ")) + return fmt.Sprintf("tuple(%s)", strings.Join(exprs, ", ")) // can omit "tuple", but I think SQL's more readable with it } } diff --git a/quesma/queryparser/query_translator_test.go b/quesma/queryparser/query_translator_test.go index 631f9fad4..9a9a9fd0a 100644 --- a/quesma/queryparser/query_translator_test.go +++ b/quesma/queryparser/query_translator_test.go @@ -182,7 +182,7 @@ func TestMakeResponseSearchQuery(t *testing.T) { t.Run(tt.queryType.String(), func(t *testing.T) { hitQuery := query_util.BuildHitsQuery( context.Background(), "test", []string{"*"}, - &model.SimpleQuery{}, model.WeNeedUnlimitedCount, nil, + &model.SimpleQuery{}, model.WeNeedUnlimitedCount, model.SearchAfterEmpty, ) highlighter := NewEmptyHighlighter() queryType := typical_queries.NewHits(cw.Ctx, cw.Table, &highlighter, hitQuery.SelectCommand.OrderByFieldNames(), true, false, false, []string{cw.Table.Name}) diff --git a/quesma/quesma/schema_transformer.go b/quesma/quesma/schema_transformer.go index c7ac98705..67c449419 100644 --- a/quesma/quesma/schema_transformer.go +++ b/quesma/quesma/schema_transformer.go @@ -21,11 +21,11 @@ type SchemaCheckPass struct { searchAfterStrategy searchAfterStrategy } -func NewSchemaCheckPass(cfg *config.QuesmaConfiguration, tableDiscovery clickhouse.TableDiscovery, searchAfterStrategy searchAfterStrategyType) *SchemaCheckPass { +func NewSchemaCheckPass(cfg *config.QuesmaConfiguration, tableDiscovery clickhouse.TableDiscovery, strategyType searchAfterStrategyType) *SchemaCheckPass { return &SchemaCheckPass{ cfg: cfg, tableDiscovery: tableDiscovery, - searchAfterStrategy: searchAfterStrategyFactory(searchAfterStrategy), + searchAfterStrategy: searchAfterStrategyFactory(strategyType), } } @@ -890,6 +890,7 @@ func (s *SchemaCheckPass) applyAliasColumns(indexSchema schema.Schema, query *mo } func (s *SchemaCheckPass) Transform(queries []*model.Query) ([]*model.Query, error) { + transformationChain := []struct { TransformationName string Transformation func(schema.Schema, *model.Query) (*model.Query, error) @@ -941,7 +942,6 @@ func (s *SchemaCheckPass) Transform(queries []*model.Query) ([]*model.Query, err query, err = transformation.Transformation(query.Schema, query) if err != nil { - fmt.Println("SchemaCheckPass.Transform", err) return nil, err }