1

我在 Hive 0.13 中有键/值表(键和值是 avro 类型)。当我尝试在 Spark SQL 1.1 中运行查询时,出现以下错误(在 Hive 中有效)

spark-sql> describe construct;
...
key struct<constructtype:string,...> from deserializer
value struct<...> from deserializer
...

spark-sql> select key.constructtype, count(*) from construct group by key.constructtype;
...

4/09/16 03:19:30 ERROR thriftserver.SparkSQLDriver: Failed in [select key.constructtype, count(*) from  construct group by key.constructtype]
org.apache.spark.sql.catalyst.errors.package$TreeNodeException: Unresolved attributes: 'key.constructtype,'key.constructtype, tree:
Aggregate ['key.constructtype], ['key.constructtype,COUNT(1) AS c_1#0L]
4

1 回答 1

1

查看 spark avro lib,看看这是否有效:

https://github.com/databricks/spark-avro

于 2015-06-12T23:47:28.697 回答