-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use assignments instead of variable name in Elasticsearch #11354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test?
cc @wendigo
@@ -546,14 +547,16 @@ public ConnectorTableProperties getTableProperties(ConnectorSession session, Con | |||
// TODO Support ESCAPE character when it's pushed down by the engine | |||
if (LIKE_PATTERN_FUNCTION_NAME.equals(call.getFunctionName()) && call.getArguments().size() == 2 && | |||
call.getArguments().get(0) instanceof Variable && call.getArguments().get(1) instanceof Constant) { | |||
String columnName = ((Variable) call.getArguments().get(0)).getName(); | |||
String name = ((Variable) call.getArguments().get(0)).getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name -> variableName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Object pattern = ((Constant) call.getArguments().get(1)).getValue(); | ||
if (!newRegexes.containsKey(columnName) && pattern instanceof Slice) { | ||
if (!newRegexes.containsKey(column.getName()) && pattern instanceof Slice) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract columnName
variable for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There is |
08559e0
to
1e09a6b
Compare
I guess the test was not failing before the change, so while it exercises the code, it was not exactly what i was looking for. Anyway, perhaps we don't need that. |
No description provided.