yaooqinn commented on a change in pull request #26599: [SPARK-29961][SQL]
Implement builtin function - typeof
URL: https://github.com/apache/spark/pull/26599#discussion_r348372839
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -177,3 +177,22 @@ case class Version() extends LeafExpression with
CodegenFallback {
UTF8String.fromString(SPARK_VERSION_SHORT + " " + SPARK_REVISION)
}
}
+
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+ usage = """_FUNC_(expr) - Return readable string representation for the data
type of the input.""",
+ examples = """
+ Examples:
+ > SELECT _FUNC_(1);
+ int
+ > SELECT _FUNC_(array(1));
+ array<int>
+ """,
+ since = "3.0.0")
+// scalastyle:on line.size.limit
+case class TypeOf(child: Expression) extends UnaryExpression with
CodegenFallback {
Review comment:
> Oh, right! I missed it's foldable and will be constant-folded in the
optimizer..
shall I rm the codegen then?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]