spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yin Huai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-10741) Hive Query Having/OrderBy against Parquet table is not working
Date Thu, 24 Sep 2015 18:50:05 GMT

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

Yin Huai commented on SPARK-10741:
----------------------------------

[~ianlcsd] Does {{select "test1" as c1, (count(*)+1) *10 as c2 from tmp}} give you the expected
result? You may hit a limitation that we cannot select from a table and then insert data back
to itself. Can you try creating another table {{tmp1}}? So, for your {{INSERT}} command, the
source and destination are different.

> Hive Query Having/OrderBy against Parquet table is not working 
> ---------------------------------------------------------------
>
>                 Key: SPARK-10741
>                 URL: https://issues.apache.org/jira/browse/SPARK-10741
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.0
>            Reporter: Ian
>            Assignee: Wenchen Fan
>
> Failed Query with Having Clause
> {code}
>   def testParquetHaving() {
>     val ddl =
>       """CREATE TABLE IF NOT EXISTS test ( c1 string, c2 int ) STORED AS PARQUET"""
>     val failedHaving =
>       """ SELECT c1, avg ( c2 ) as c_avg
>         | FROM test
>         | GROUP BY c1
>         | HAVING ( avg ( c2 ) > 5)  ORDER BY c1""".stripMargin
>     TestHive.sql(ddl)
>     TestHive.sql(failedHaving).collect
>   }
> org.apache.spark.sql.AnalysisException: resolved attribute(s) c2#16 missing from c1#17,c2#18
in operator !Aggregate [c1#17], [cast((avg(cast(c2#16 as bigint)) > cast(5 as double))
as boolean) AS havingCondition#12,c1#17,avg(cast(c2#18 as bigint)) AS c_avg#9];
> 	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.failAnalysis(CheckAnalysis.scala:37)
> 	at org.apache.spark.sql.catalyst.analysis.Analyzer.failAnalysis(Analyzer.scala:44)
> 	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1.apply(CheckAnalysis.scala:154)
> 	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1.apply(CheckAnalysis.scala:49)
> {code}
> Failed Query with OrderBy
> {code}
>   def testParquetOrderBy() {
>     val ddl =
>       """CREATE TABLE IF NOT EXISTS test ( c1 string, c2 int ) STORED AS PARQUET"""
>     val failedOrderBy =
>       """ SELECT c1, avg ( c2 ) c_avg
>         | FROM test
>         | GROUP BY c1
>         | ORDER BY avg ( c2 )""".stripMargin
>     TestHive.sql(ddl)
>     TestHive.sql(failedOrderBy).collect
>   }
> org.apache.spark.sql.AnalysisException: resolved attribute(s) c2#33 missing from c1#34,c2#35
in operator !Aggregate [c1#34], [avg(cast(c2#33 as bigint)) AS aggOrder#31,c1#34,avg(cast(c2#35
as bigint)) AS c_avg#28];
> 	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.failAnalysis(CheckAnalysis.scala:37)
> 	at org.apache.spark.sql.catalyst.analysis.Analyzer.failAnalysis(Analyzer.scala:44)
> {code}



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