【问题标题】:How to query Avro table in Spark SQL如何在 Spark SQL 中查询 Avro 表
【发布时间】:2014-09-16 07:27:30
【问题描述】:

我在 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]

【问题讨论】:

    标签: apache-spark hiveql apache-spark-sql


    【解决方案1】:

    查看 spark avro 库,看看是否可行:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-25
      • 2017-04-17
      • 2018-03-08
      • 2017-04-12
      • 1970-01-01
      • 2023-01-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多