[
https://issues.apache.org/jira/browse/SPARK-5710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14313729#comment-14313729
]
Apache Spark commented on SPARK-5710:
-------------------------------------
User 'guowei2' has created a pull request for this issue:
https://github.com/apache/spark/pull/4497
> Combines two adjacent `Cast` expressions into one
> -------------------------------------------------
>
> Key: SPARK-5710
> URL: https://issues.apache.org/jira/browse/SPARK-5710
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 1.3.0
> Reporter: guowei
>
> A plan after `analyzer` with `typeCoercionRules` may produce many `cast`
> expressions. we can combine the adjacent ones.
> For example.
> create table test(a decimal(3,1));
> explain select * from test where a*2-1>1;
> == Physical Plan ==
> Filter (CAST(CAST((CAST(CAST((CAST(a#5, DecimalType()) * 2),
> DecimalType(21,1)), DecimalType()) - 1), DecimalType(22,1)), DecimalType()) >
> 1)
> HiveTableScan [a#5], (MetastoreRelation default, test, None), None
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]