panbingkun commented on code in PR #48087:
URL: https://github.com/apache/spark/pull/48087#discussion_r1757965185
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala:
##########
@@ -618,3 +619,45 @@ case class SQLKeywords() extends LeafExpression with
Generator with CodegenFallb
override def prettyName: String = "sql_keywords"
}
+
+@ExpressionDescription(
+ usage = """_FUNC_() - Get Spark SQL all collations""",
+ examples = """
+ Examples:
+ > SELECT * FROM _FUNC_() LIMIT 2;
+ SYSTEM BUILTIN UTF8_BINARY NULL NULL ACCENT_SENSITIVE
CASE_SENSITIVE NO_PAD NULL
+ SYSTEM BUILTIN UTF8_LCASE NULL NULL ACCENT_SENSITIVE
CASE_INSENSITIVE NO_PAD NULL
+ """,
+ since = "4.0.0",
+ group = "generator_funcs")
+case class AllCollations() extends LeafExpression with Generator with
CodegenFallback {
+ override def elementSchema: StructType = new StructType()
+ .add("COLLATION_CATALOG", StringType, nullable = false)
+ .add("COLLATION_SCHEMA", StringType, nullable = false)
+ .add("COLLATION_NAME", StringType, nullable = false)
+ .add("LANGUAGE", StringType)
+ .add("COUNTRY", StringType)
+ .add("ACCENT_SENSITIVITY", StringType, nullable = false)
+ .add("CASE_SENSITIVITY", StringType, nullable = false)
Review Comment:
https://github.com/apache/spark/pull/47364#issuecomment-2242283304
<img width="927" alt="image"
src="https://github.com/user-attachments/assets/fcdb240d-5c87-4921-b623-49dc8c7b565f">
Based on @mihailom-db's suggestion, this is designed as `a string type`. Of
course, as `a boolean type`, I also think it's okay. I will update it according
to your final decision.
--
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]