cloud-fan commented on PR #47364:
URL: https://github.com/apache/spark/pull/47364#issuecomment-2345184836
BTW we already have a TVF to get all the SQL keywords
```
@ExpressionDescription(
usage = """_FUNC_() - Get Spark SQL keywords""",
examples = """
Examples:
> SELECT * FROM _FUNC_() LIMIT 2;
ADD false
AFTER false
""",
since = "3.5.0",
group = "generator_funcs")
case class SQLKeywords() extends LeafExpression with Generator with
CodegenFallback {
override def elementSchema: StructType = new StructType()
.add("keyword", StringType, nullable = false)
.add("reserved", BooleanType, nullable = false)
override def eval(input: InternalRow): IterableOnce[InternalRow] = {
val reservedList = getReservedList()
keywords.zip(reservedList).map { case (keyword, isReserved) =>
InternalRow(UTF8String.fromString(keyword), isReserved)
}
}
override def prettyName: String = "sql_keywords"
}
```
--
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]