Hisoka-X commented on code in PR #42661:
URL: https://github.com/apache/spark/pull/42661#discussion_r1306309397
##########
sql/core/src/test/resources/sql-tests/analyzer-results/try_reflect.sql.out:
##########
@@ -0,0 +1,165 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+SELECT try_reflect("java.util.UUID", "fromString",
"a5cf6c42-0c85-418f-af6c-3e4e5b1328f2")
+-- !query analysis
+Project [try_reflect(java.util.UUID, fromString,
a5cf6c42-0c85-418f-af6c-3e4e5b1328f2) AS try_reflect(java.util.UUID,
fromString, a5cf6c42-0c85-418f-af6c-3e4e5b1328f2)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.lang.String", "valueOf", 1)
+-- !query analysis
+Project [try_reflect(java.lang.String, valueOf, 1) AS
try_reflect(java.lang.String, valueOf, 1)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.lang.Math", "max", 2, 3)
+-- !query analysis
+Project [try_reflect(java.lang.Math, max, 2, 3) AS try_reflect(java.lang.Math,
max, 2, 3)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.lang.Math", "min", 2, 3)
+-- !query analysis
+Project [try_reflect(java.lang.Math, min, 2, 3) AS try_reflect(java.lang.Math,
min, 2, 3)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.lang.Integer", "valueOf", "10", 16)
+-- !query analysis
+Project [try_reflect(java.lang.Integer, valueOf, 10, 16) AS
try_reflect(java.lang.Integer, valueOf, 10, 16)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.util.UUID", "fromString", "b")
+-- !query analysis
+Project [try_reflect(java.util.UUID, fromString, b) AS
try_reflect(java.util.UUID, fromString, b)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.net.URLDecoder", "decode", "%")
+-- !query analysis
+Project [try_reflect(java.net.URLDecoder, decode, %) AS
try_reflect(java.net.URLDecoder, decode, %)#x]
++- OneRowRelation
+
+
+-- !query
+SELECT try_reflect("java.lang.Math", "max", "test", 3)
+-- !query analysis
+org.apache.spark.SparkException
+{
+ "errorClass" : "INTERNAL_ERROR",
+ "sqlState" : "XX000",
+ "messageParameters" : {
+ "message" : "Cannot resolve the runtime replaceable expression
\"try_reflect(java.lang.Math, max, test, 3)\". The replacement is unresolved:
\"reflect(java.lang.Math, max, test, 3)\"."
+ }
+}
Review Comment:
When replacement expression `checkInputDataTypes` return failed, this error
will be reported. It's not `try_reflect`'s bug, it's all `RuntimeReplaceable`
will face problem. In fact if we can throw `checkInputDataTypes` failed reason
would be better. I'm trying solve it on another PR. cc @cloud-fan
--
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]