[ 
https://issues.apache.org/jira/browse/SPARK-8653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14609609#comment-14609609
 ] 

Cheng Hao commented on SPARK-8653:
----------------------------------

For most of the Mathematical expressions, we can get the generic rule for the 
data type casting implicitly. But seems arbitrary rules for the others. For 
example, there are lots of custom rules for `Coalesce`, Conditional 
expressions, (CaseWhen, In, If etc.) already, we probably don't want to keep 
growing the rules in the `HiveTypeCoercion.scala`.

So probably it's a good a idea to expose the data type casting to expression 
itself, and the UDAF, UDTF will also be benifit from that. Additionally, if we 
want to make the `Expression` as API for extension in the future, it will be a 
block issue if the data type casting is only allowed to be done in 
`HiveTypeCoercion.scala`.

> Add constraint for Children expression for data type
> ----------------------------------------------------
>
>                 Key: SPARK-8653
>                 URL: https://issues.apache.org/jira/browse/SPARK-8653
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Cheng Hao
>            Assignee: Reynold Xin
>
> Currently, we have trait in Expression like `ExpectsInputTypes` and also the 
> `checkInputDataTypes`, but can not convert the children expressions 
> automatically, except we write the new rules in the `HiveTypeCoercion`.



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