Support access to nested field of struct after fields command#4719
Support access to nested field of struct after fields command#4719yuancu merged 1 commit intoopensearch-project:mainfrom
Conversation
Signed-off-by: Heng Qian <qianheng@amazon.com>
| // TODO: should use RelRecordType instead of MapSqlType here | ||
| // https://github.com/opensearch-project/sql/issues/3459 | ||
| final RelDataType relKey = TYPE_FACTORY.createSqlType(SqlTypeName.VARCHAR); | ||
| // TODO: should we provide more precise type here? |
There was a problem hiding this comment.
Non-blocking: Do you have any idea how to specify precise type here? Calcite 1.41.0 has more strict type checking in RexToLixTranslator. If the Map value is another Array type, it cannot cast a ANY to Array.
There was a problem hiding this comment.
Maybe we can do type-conversion recursively for the nested fields and store them in a customized type? It will has benefit to resolve proper functions for these fields.
What's more I'm thinking we may be able to deprecate the flatten fields if these nested fields' type are precise enough. It's not worthy to do that now since we have flatten fields and it only takes effect after FIELD command. It should be done as another issue for enhancement.
There was a problem hiding this comment.
Signed-off-by: Heng Qian <qianheng@amazon.com> (cherry picked from commit e06ebc5) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…#4727) (cherry picked from commit e06ebc5) Signed-off-by: Heng Qian <qianheng@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Heng Qian <qianheng@amazon.com>
…arch-project#4719) Signed-off-by: Heng Qian <qianheng@amazon.com>
Description
Support access to nested field of struct after fields command
Related Issues
Resolves #3459
Check List
--signoffor-s.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.