-
Notifications
You must be signed in to change notification settings - Fork 151
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
[Calcite engine] Support nested field #3476
[Calcite engine] Support nested field #3476
Conversation
Signed-off-by: Heng Qian <[email protected]>
…calcite-engine-nested
Signed-off-by: Heng Qian <[email protected]>
@@ -160,6 +163,23 @@ public RelNode visitProject(Project node, CalcitePlanContext context) { | |||
return context.relBuilder.peek(); | |||
} | |||
|
|||
/** See logic in {@link org.opensearch.sql.analysis.symbol.SymbolTable#lookupAllFields} */ |
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.
there is a bug in V2. could you check is it existing in this pr? #3477
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.
Has a new discovery for that issue: #3477 (comment)
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.
Thanks for correcting. Anyway, my point is for the field name with dot. But seems the field with dot in OpenSearch are all treated as nested type.
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.
Add comments, we should handle this case in future. #3477 (comment)
verifySchema(result, schema("count()", "integer"), schema("city.name", "string")); | ||
verifySchema( | ||
result, | ||
schema("count()", isCalciteEnabled() ? "long" : "integer"), |
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.
merge from main, it should be bigint and int now.
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.
resolved
@@ -160,6 +163,23 @@ public RelNode visitProject(Project node, CalcitePlanContext context) { | |||
return context.relBuilder.peek(); | |||
} | |||
|
|||
/** See logic in {@link org.opensearch.sql.analysis.symbol.SymbolTable#lookupAllFields} */ |
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.
Add comments, we should handle this case in future. #3477 (comment)
…calcite-engine-nested # Conflicts: # integ-test/src/test/java/org/opensearch/sql/ppl/ObjectFieldOperateIT.java
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.
failures not related, due to #3471 .merging to main.
Description
Support nested field
Implementation options
option1(This PR): For opensearch index, since we already have nested fields flattened and accessible in the mapping information, we just have to fill the flatten nested fields with its related value, then it could support access to the nested fields as well as get the correct value.
option2: [FEATURE][Calcite Engine] Support access to nested fields after command
FIELDS
#3459Related Issues
Resolves #3452
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.