spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-5710) Combines two adjacent `Cast` expressions into one
Date Sun, 22 Feb 2015 08:47:11 GMT

     [ https://issues.apache.org/jira/browse/SPARK-5710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sean Owen updated SPARK-5710:
-----------------------------
             Priority: Minor  (was: Major)
    Affects Version/s:     (was: 1.3.0)
                       1.2.1

The original suggested PR couldn't be merged, but I wonder if another is going to be proposed
for the narrower change, to merge identical neighboring casts?

> 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.2.1
>            Reporter: guowei
>            Priority: Minor
>
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message