You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "voonhous (via GitHub)" <gi...@apache.org> on 2026/08/02 07:52:22 UTC

Re: [I] chore(spark): prune dead code left in the six extended SQL AST builders after #19132 [hudi]

voonhous commented on issue #19451:
URL: https://github.com/apache/hudi/issues/19451#issuecomment-5156342297

   Two corrections found while implementing this in #19455:
   
   - **`visitBooleanLiteral` is NOT dead.** The premise "TRUE/FALSE are in `ansiNonReserved`" holds only for `TRUE`; `FALSE` (like `NULL`) is absent from `ansiNonReserved` in all six grammars. Under ANSI keyword mode (`SQL_standard_keyword_behavior = conf.ansiEnabled`, the Spark 4.x default) `PARTITIONED BY (f(false, id))` parses `false` as a `BooleanLiteralContext`, so deleting the visitor turns a working parse into a raw NPE (`Some(null).map(lit => lit.value)` in `visitTransformArgument`). Same mode-dependence as the `visitNullLiteral` carve-out already noted above. Kept, with an ANSI-mode regression test.
   - **`validateRowFormatFileFormat`'s `case _` is reachable**: `ROW FORMAT SERDE 'x' STORED BY 'y'` parses (`rowFormat` and `createFileFormat` coexist in `createTableClauses`), `STORED BY` leaves `createFileFormatCtx.fileFormat` null, and `(rowFormatCtx, null)` falls past the three typed arms. `getSerdeInfo` calls the validator before `visitCreateFileFormat`, so this arm is the live error path for that SQL. Kept, now test-covered.
   
   Everything else on the list verified dead and is removed in #19455. Side observation, possibly worth its own issue: the fork's `ansiNonReserved` containing `TRUE` but not `FALSE`/`NULL` is an asymmetry inherited into all six `imports/SqlBase.g4` copies.
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org