对于以 orc 格式在配置单元中创建且数据驻留在 s3 中的 table,在 presto-cli 上查询失败

Query fails on presto-cli for a table created in hive in orc format with data residing in s3

我设置了一个 Amazon EMR 实例,其中包括 1 个 Master 和 1 个 Core(m4 Large),具有以下版本详细信息: 电子病历:5.5.0 急速:急速 0.170 Hadoop 2.7.3 HDFS 配置单元 2.1.1 元存储

我的 Spark 应用程序将 ORC 中的数据写入 Amazon S3。然后我在 hive (create external table TABLE ... partition() stored as ORC location 's3a"//') 中创建了 table,并尝试从 presto-cli 进行查询,我得到以下查询 SELECT * from TABLE 的错误: 查询 20170615_033508_00016_dbhsn 失败:com.facebook.presto.spi.type.DoubleType

唯一有效的查询是: SELECT COUNT(*) from TABLE

有什么想法吗?

找到问题了。存储为 orc 时的列顺序与在 hive 中创建 table 时的列顺序不匹配:)!!!