You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2016/04/18 21:27:25 UTC
[jira] [Resolved] (SPARK-14580) HiveTypeCoercion.IfCoercion should
preserve original predicates.
[ https://issues.apache.org/jira/browse/SPARK-14580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reynold Xin resolved SPARK-14580.
---------------------------------
Resolution: Fixed
Assignee: Dongjoon Hyun
Fix Version/s: 2.0.0
> HiveTypeCoercion.IfCoercion should preserve original predicates.
> ----------------------------------------------------------------
>
> Key: SPARK-14580
> URL: https://issues.apache.org/jira/browse/SPARK-14580
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.6.1, 2.0.0
> Reporter: Dongjoon Hyun
> Assignee: Dongjoon Hyun
> Fix For: 2.0.0
>
>
> Currently, `HiveTypeCoercion.IfCoercion` removes all predicates whose return-type is null. However, some UDFs need evaluations because they are designed to throw exceptions.
> *Hive*
> {code}
> hive> select if(assert_true(false),2,3);
> OK
> Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: ASSERT_TRUE(): assertion failed.
> {code}
>
> *Spark*
> {code}
> scala> sql("select if(assert_true(false),2,3)").head
> res2: org.apache.spark.sql.Row = [3]
> {code}
> `IfCoercion` works like the followings.
> {code}
> === Applying Rule org.apache.spark.sql.catalyst.analysis.HiveTypeCoercion$IfCoercion ===
> !'Project [unresolvedalias(if (HiveGenericUDF#org.apache.hadoop.hive.ql.udf.generic.GenericUDFAssertTrue(false)) 2 else 3)] 'Project [unresolvedalias(if (nu
> ll) 2 else 3)]
> +- OneRowRelation$ +- OneRowRelation$
> {code}
> This issue aims to fix this and to add `assert_true` as a Spark SQL function.
--
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