Preserve original expression text as column name in unified SQL#5392
Preserve original expression text as column name in unified SQL#5392dai-chen wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
Calcite's SqlToRelConverter names unnamed SELECT items EXPR$0, EXPR$1, etc. - surprising versus PostgreSQL/MySQL/Spark. Fix by adding SelectItemAliasRewriter, a pre-validation SqlShuttle that wraps unnamed, non-identifier items with AS <text> via the existing LanguageSpec.postParseRules hook. SELECT COUNT(*) FROM t -> `COUNT(*)` (was EXPR$0) SELECT UPPER(name) -> `UPPER(name)` SELECT x AS y, name, * -> unchanged Resolves opensearch-project#5332 Signed-off-by: Chen Dai <daichen@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description [WIP]
Calcite's SqlToRelConverter names unnamed SELECT items EXPR$0, EXPR$1, etc. - surprising versus PostgreSQL/MySQL/Spark. Fix by adding SelectItemAliasRewriter, a pre-validation SqlShuttle that wraps unnamed, non-identifier items with AS via the existing LanguageSpec.postParseRules hook.
Related Issues
Resolves #5332
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.