我在 GCP 存储桶中有以下格式的数据:
gs://bucket/my_table/data_date=2021-03-26/000
gs://bucket/my_table/data_date=2021-03-26/001
gs://bucket/my_table/data_date=2021-03-27/000
gs://bucket/my_table/data_date=2021-03-27/001
我正在使用以下数据创建外部表:
CREATE EXTERNAL TABLE `my_db.my_table`(
`col1` string,
`col2` string,
PARTITIONED BY (
`data_date` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES (
'field.delim'='\t',
'serialization.format'='\t')
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'gs://bucket/my_table/'
创建表时没有错误:
hive > CREATE EXTENAL TABLE ...
Time Taken: 0.012 seconds
OK
但是,我看不到任何数据。即使存储桶中有数据文件,以下命令也不会返回任何内容。
hive> show partitions my_db.my_table;
Ok
Time taken: 0.191 seconds
hive> select * from my_db.my_table;
Ok
Time taken: 0.191 seconds
我也没有看到任何错误。我已经验证并且我确实拥有存储桶的读取权限。
最佳答案
关于google-cloud-platform - GCP dataproc 上的外部 Hive 表未从 GCP 存储桶中读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66966055/