Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
trzysiek committed Mar 3, 2025
1 parent 16c8874 commit 977998d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions platform/frontend_connectors/schema_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,10 +1023,8 @@ func (s *SchemaCheckPass) applyMatchOperator(indexSchema schema.Schema, query *m
lhs, ok := e.Left.(model.ColumnRef)
rhs, ok2 := e.Right.(model.LiteralExpr)

fmt.Println("lhs", lhs, "op", e.Op, "rhs", rhs)
if ok && ok2 && e.Op == model.MatchOperator {
field, found := indexSchema.ResolveFieldByInternalName(lhs.ColumnName)
fmt.Println(field, found)
if !found {
logger.Error().Msgf("Field %s not found in schema for table %s, should never happen here", lhs.ColumnName, query.TableName)
}
Expand All @@ -1035,10 +1033,8 @@ func (s *SchemaCheckPass) applyMatchOperator(indexSchema schema.Schema, query *m
rhsValue = strings.TrimPrefix(rhsValue, "'")
rhsValue = strings.TrimSuffix(rhsValue, "'")

fmt.Println(field.Type.String())
switch field.Type.String() {
case schema.QuesmaTypeInteger.Name, schema.QuesmaTypeLong.Name, schema.QuesmaTypeUnsignedLong.Name, schema.QuesmaTypeBoolean.Name:
rhsValue = strings.Trim(rhsValue, "%")
return model.NewInfixExpr(lhs, "=", model.NewLiteral(rhsValue))
default:
return model.NewInfixExpr(lhs, "iLIKE", model.NewLiteralWithEscapeType(rhsValue, model.NotEscapedLikeFull))
Expand Down

0 comments on commit 977998d

Please sign in to comment.