spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Armbrust (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-5875) logical.Project should not be resolved if it contains aggregates or generators
Date Wed, 18 Feb 2015 01:51:13 GMT

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

Michael Armbrust resolved SPARK-5875.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.3.0

Issue resolved by pull request 4663
[https://github.com/apache/spark/pull/4663]

> logical.Project should not be resolved if it contains aggregates or generators
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-5875
>                 URL: https://issues.apache.org/jira/browse/SPARK-5875
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Yin Huai
>            Priority: Blocker
>             Fix For: 1.3.0
>
>
> To reproduce...
> {code}
> val rdd = sc.parallelize((1 to 10).map(i => s"""{"a":$i, "b":"str${i}"}"""))
> sqlContext.jsonRDD(rdd).registerTempTable("jt")
> sqlContext.sql("CREATE TABLE gen_tmp (key Int)")
> sqlContext.sql("INSERT OVERWRITE TABLE gen_tmp SELECT explode(array(1,2,3)) AS val FROM
jt LIMIT 1")
> {code}
> The exception is
> {code}
> org.apache.spark.sql.AnalysisException: invalid cast from array<struct<_c0:int>>
to int;
>     at org.apache.spark.sql.catalyst.analysis.Analyzer$CheckResolution$.failAnalysis(Analyzer.scala:85)
>     at org.apache.spark.sql.catalyst.analysis.Analyzer$CheckResolution$$anonfun$apply$18$$anonfun$apply$2.applyOrElse(Analyzer.scala:98)
>     at org.apache.spark.sql.catalyst.analysis.Analyzer$CheckResolution$$anonfun$apply$18$$anonfun$apply$2.applyOrElse(Analyzer.scala:92)
>     at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250)
>     at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:250)
>     at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:50)
>     at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:249)
>     at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$5.apply(TreeNode.scala:263)
> {code}
> The cause of this exception is that PreInsertionCasts in HiveMetastoreCatalog was triggered
on an invalid query plan 
> {code}
> Project [HiveGenericUdtf#org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode(Array(1,2,3))
AS val#19]
>   Subquery jt
>    LogicalRDD [a#0L,b#1], MapPartitionsRDD[4] at map at JsonRDD.scala:41
> {code}
> Then, after the transformation of PreInsertionCasts, ImplicitGenerate cannot be applied.



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