Hyukjin Kwon created SPARK-18179:
------------------------------------
Summary: Throws analysis exception with a proper message for
unsupported argument types in reflect/java_method function
Key: SPARK-18179
URL: https://issues.apache.org/jira/browse/SPARK-18179
Project: Spark
Issue Type: Improvement
Components: SQL
Reporter: Hyukjin Kwon
Priority: Minor
{code}
scala> spark.range(1).selectExpr("reflect('java.lang.String', 'valueOf',
cast('1990-01-01' as timestamp))")
{code}
throws an exception as below:
{code}
java.util.NoSuchElementException: key not found: TimestampType
at scala.collection.MapLike$class.default(MapLike.scala:228)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.MapLike$class.apply(MapLike.scala:141)
at scala.collection.AbstractMap.apply(Map.scala:59)
at
org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection$$anonfun$findMethod$1$$anonfun$apply$1.apply(CallMethodViaReflection.scala:159)
at
org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection$$anonfun$findMethod$1$$anonfun$apply$1.apply(CallMethodViaReflection.scala:158)
at
scala.collection.IndexedSeqOptimized$class.prefixLengthImpl(IndexedSeqOptimized.scala:38)
{code}
We should throw analysis exception with a better message when the types are
unsupported rather than {{java.util.NoSuchElementException: key not found:
TimestampType}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]