Skip to content

Commit

Permalink
update with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
sankari165 committed Jul 30, 2024
1 parent 3ed4532 commit 3c850b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/pinot/pinotQueryValidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (qv *VisibilityQueryValidator) processSystemKey(expr sqlparser.Expr) (strin
return "", fmt.Errorf("right comparison is invalid: %v", comparisonExpr.Right)
}
colValStr := string(colVal.Val)
return fmt.Sprintf("TEXT_MATCH(%s, %s)", colNameStr, colValStr), nil
return fmt.Sprintf("TEXT_MATCH(%s, '%s')", colNameStr, colValStr), nil
}

if comparisonExpr.Operator != sqlparser.EqualStr && comparisonExpr.Operator != sqlparser.NotEqualStr {
Expand Down
4 changes: 2 additions & 2 deletions common/pinot/pinotQueryValidator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestValidateQuery(t *testing.T) {
},
"Case2-2: simple query with partial match": {
query: "WorkflowID like 'wid'",
validated: "TEXT_MATCH(WorkflowID, wid)",
validated: "TEXT_MATCH(WorkflowID, 'wid')",
},
"Case2-3: invalid simple query with partial match": {
query: "WorkflowID like wid",
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestValidateQuery(t *testing.T) {
},
"Case6-5: complex query with partial match": {
query: "RunID like '123' or WorkflowID like '123'",
validated: "(TEXT_MATCH(RunID, 123) or TEXT_MATCH(WorkflowID, 123))",
validated: "(TEXT_MATCH(RunID, '123') or TEXT_MATCH(WorkflowID, '123'))",
},
"Case7: invalid sql query": {
query: "Invalid SQL",
Expand Down

0 comments on commit 3c850b4

Please sign in to comment.