srielau commented on code in PR #48087:
URL: https://github.com/apache/spark/pull/48087#discussion_r1758168073


##########
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:
   I have no strong opinions on this. But I like readability even for TVFs



-- 
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]

Reply via email to