Skip to content

[Calcite engine] Support nested field#3476

Merged
LantaoJin merged 4 commits intoopensearch-project:mainfrom
qianheng-aws:feature/calcite-engine-nested
Mar 26, 2025
Merged

[Calcite engine] Support nested field#3476
LantaoJin merged 4 commits intoopensearch-project:mainfrom
qianheng-aws:feature/calcite-engine-nested

Conversation

@qianheng-aws
Copy link
Collaborator

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.

Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
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
Collaborator 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
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

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
penghuo pushed a commit that referenced this pull request Jun 16, 2025
* [Calcite engine] Support nested field

Signed-off-by: Heng Qian <qianheng@amazon.com>

* Fix merging

Signed-off-by: Heng Qian <qianheng@amazon.com>

---------

Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
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