Cheng Hao created SPARK-3707:
--------------------------------

             Summary: Type Coercion for DIV doesn't work for non-numeric 
argument
                 Key: SPARK-3707
                 URL: https://issues.apache.org/jira/browse/SPARK-3707
             Project: Spark
          Issue Type: Bug
          Components: SQL
            Reporter: Cheng Hao
            Priority: Minor


When do query like "select key/2 from src", it throws exception like
{panel}
14/09/27 22:14:36 ERROR SparkSQLDriver: Failed in [select key/2 from src]
org.apache.spark.sql.catalyst.analysis.UnresolvedException: Invalid call to 
datatype. Can not resolve due to differing types DoubleType, IntegerType on 
unresolved object, tree: (CAST(key#3, DoubleType) / 2)
        at 
org.apache.spark.sql.catalyst.expressions.BinaryArithmetic.dataType(arithmetic.scala:62)
        at 
org.apache.spark.sql.catalyst.analysis.HiveTypeCoercion$Division$$anonfun$apply$9.applyOrElse(HiveTypeCoercion.scala:351)
        at 
org.apache.spark.sql.catalyst.analysis.HiveTypeCoercion$Division$$anonfun$apply$9.applyOrElse(HiveTypeCoercion.scala:346)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:144)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$4.apply(TreeNode.scala:162)
{panel}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to