Skip to content
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

Merged

Conversation

qianheng-aws
Copy link
Contributor

Description

Support nested field

Implementation options

Related Issues

Resolves #3452

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

@@ -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} */
Copy link
Member

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

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Collaborator

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)

LantaoJin
LantaoJin previously approved these changes Mar 25, 2025
verifySchema(result, schema("count()", "integer"), schema("city.name", "string"));
verifySchema(
result,
schema("count()", isCalciteEnabled() ? "long" : "integer"),
Copy link
Collaborator

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.

Copy link
Contributor Author

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} */
Copy link
Collaborator

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
Copy link
Member

@LantaoJin LantaoJin left a 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.

@LantaoJin LantaoJin merged commit 3c48804 into opensearch-project:main Mar 26, 2025
16 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
calcite calcite migration releated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support nested (object) fields with Calcite
3 participants