MaxGekk commented on code in PR #56766:
URL: https://github.com/apache/spark/pull/56766#discussion_r3473207073
##########
sql/core/src/test/scala/org/apache/spark/sql/TimeFunctionsSuiteBase.scala:
##########
@@ -108,6 +108,23 @@ abstract class TimeFunctionsSuiteBase extends
SharedSparkSession {
}
}
+ test("SPARK-57558: localtime function") {
Review Comment:
Non-blocking: this test exercises only the function form (`localtime()`,
`localtime(3)`), i.e. the `FunctionRegistry` path. The bare-keyword grammar
path (`SELECT LOCALTIME` with no parens) is covered at the parser level in
`ExpressionParserSuite`, so end-to-end coverage isn't strictly required — but a
bare `SELECT LOCALTIME` assertion here would round it out. Optional; the
existing `current_time` e2e test has the same shape, so omitting it is
consistency-neutral.
##########
sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseLexer.g4:
##########
@@ -345,6 +345,7 @@ LINES: 'LINES';
LIST: 'LIST';
LOAD: 'LOAD';
LOCAL: 'LOCAL';
+LOCALTIME: 'LOCALTIME';
Review Comment:
Adding `LOCALTIME` to the lexer puts it in the grammar's
`SPARK-KEYWORD-LIST`, which `SQLKeywordSuite."all keywords are documented"`
cross-checks against the manually-maintained keyword table in
`docs/sql-ref-ansi-compliance.md`. That table currently has no `LOCALTIME` row,
so the suite will fail with `Some keywords are not documented: LOCALTIME`.
Add the row alphabetically between `LOCAL` and `LOCATION` (line ~628),
identical to the existing `CURRENT_TIME` row:
```
|LOCALTIME|reserved|non-reserved|reserved|
```
This matches the implemented status (reserved in ANSI mode — absent from
`ansiNonReserved`; non-reserved in default mode — present in `nonReserved`) and
`LOCALTIME` being a SQL-2016 reserved word, so all three of `SQLKeywordSuite`'s
documentation checks pass.
--
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]