我有一个正在使用AWS Glue元存储的Hive表。数据位于S3上,我们按年,月和唯一编号进行分区。
我使用AWS EMR spark-sql运行查询
这是一个示例表结构:
String Date Int Int String
s3_url rec_dt yr_number mth_number uniq_id
s3://path/example.txt 2020-03-16 2020 3 4195
现在,只要在以下命令下运行,只要查询此表,它都可以正常运行:
select s3_url from table where (rec_dt in ('2020-03-16'))
但是,当我添加以下参数时,它会引发错误:
select s3_url from table where (rec_dt in ('2020-03-16')) and yr_number=2020;
错误
Error in query: org.apache.hadoop.hive.metastore.api.InvalidObjectException:
For input string: "__HIVE_D" is not an integer.
(Service: AWSGlue; Status Code: 400; Error Code: InvalidInputException;
Request ID: 586ff8e1-8f67-4593-940d-9f992a073be3);
我也检查了表模式,该列是一个int,我也传递了一个int值。
最佳答案
似乎这清楚地表明了 hive 目录和胶目录的结构不匹配。您说您已经在该列中看到了 hive 目录
检查AWS胶目录中的此列是否具有指定的数据类型。
用于检查架构详细信息的UI示例...
我希望你正在使用the AWS Glue Data Catalog as the Hive metastore
关于amazon-web-services - 配置单元查询抛出错误输入字符串: “__HIVE_D”不是整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60729320/