FrankChen021 commented on code in PR #20402:
URL: https://github.com/apache/druid/pull/20402#discussion_r4071496823
##########
sql/src/main/codegen/templates/Parser.jj:
##########
@@ -6319,7 +6319,7 @@ SqlTypeNameSpec SqlTypeName1(Span s) :
s.add(this); sqlTypeName = unsigned ? SqlTypeName.USMALLINT :
SqlTypeName.SMALLINT;
}
|
- <BIGINT> ( <UNSIGNED> { unsigned = true; })? {
+ ( <BIGINT> | <LONG> ) ( <UNSIGNED> { unsigned = true; })? {
Review Comment:
[P1] LONG changes existing DDL type parsing
**Finding:** SqlTypeName1 is called by DataType(), not just CAST. Adding
<LONG> therefore makes every Druid DDL/type position parse LONG as
SqlTypeName.BIGINT. The unchanged
DruidSqlDdlParserTest.testColumnNamedProjection currently expects `CREATE TABLE
t (projection LONG)` to remain a bare user-defined/native type and render as
`projection `LONG``; this head selects the new BIGINT branch instead, breaking
that test and changing the AST/unparse contract for existing DDL.
**Suggestion:** Keep LONG scoped to the CAST type grammar, or deliberately
widen the type-name contract and update the DDL/EXTEND/other DataType call
sites, tests, and documentation together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]