HIVE_CANNOT_OPEN_SPLIT:打开Hive拆分s3:// path / to / file / <> .snappy.parquet时出错:列ai.ja类型null不支持
仅当我定义“ JA”列(这是字符串结构)时,才会发生这种情况。如果我不列出该列,则可以毫无问题地进行查询。模式信息是使用Apache Spark从我们的镶木文件中获得的。
The create table statement I'm using to reproduce the error follows:
CREATE EXTERNAL TABLE <<tablename>>(`ai` struct < acs : varchar(100), ltc : varchar(100), primaryapplicant : struct < bwh : varchar(10), citizenship : varchar(20), currentaddresscity : varchar(50), currentaddressstate : varchar(50), currentaddressstreet2 : varchar(50), ss : varchar(50)>, JA : array < struct < dateofbirth : varchar(50), emailaddress : varchar(50), firstname : varchar(50), lastname : varchar(50), ss : varchar(50)>>, status : varchar(50), uri : varchar(50)>, `pr` struct < pc : struct < cn : varchar(50)>>, `product` array < struct < at : varchar(20), pi : varchar(50), pmn : varchar(256)>>, `ipt` varchar(40) ) PARTITIONED BY ( `owner` varchar(40) ) ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat' LOCATION 's3://<location>' TBLPROPERTIES ( 'compression_type' = 'snappy', 'numRows' = '2', 'transient_lastDdlTime' = <> )
正在从实木复合地板文件中读取。
Parquet schema :
root
|-- ai: struct (nullable = true)
| |-- acs: string (nullable = true)
| |-- JA: struct (nullable = true)
| | |-- DateOfBirth: string (nullable = true)
| | |-- EmailAddress: string (nullable = true)
| | |-- FirstName: string (nullable = true)
| | |-- LastName: string (nullable = true)
| | |-- ss: string (nullable = true)
| |-- ltc: string (nullable = true)
| |-- PrimaryApplicant: struct (nullable = true)
| | |-- bwh: string (nullable = true)
| | |-- Citizenship: string (nullable = true)
| | |-- CurrentAddressCity: string (nullable = true)
| | |-- CurrentAddressState: string (nullable = true)
| | |-- CurrentAddressStreet2: string (nullable = true)
| | |-- ss: string (nullable = true)
| |-- Status: string (nullable = true)
| |-- uri: string (nullable = true)
|-- pr: struct (nullable = true)
| |-- pc: struct (nullable = true)
| | |-- cn: string (nullable = true)
|-- Product: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- at: string (nullable = true)
| | |-- pi: string (nullable = true)
| | |-- pmn: string (nullable = true)
|-- ipt: string (nullable = true)
此链接https://forums.aws.amazon.com/thread.jspa?threadID=246551上存在相同的问题。 但仍然无法弄清楚。
有人可以帮忙吗?
答案 0 :(得分:0)
此问题已解决。
为创建Athena表,每个字段应准确映射到架构,即每个字段的顺序应与架构相同。