hive 在S3中没有看到文件级下推 predicate 过滤查询配置单元分区表

r7xajy2e  于 2023-10-18  发布在  Hive
关注(0)|答案(1)|浏览(182)

我在DuckDB-WASM中使用DuckDB。我在S3中使用SQL在一个分区表的顶部创建一个视图,如下所示:

  1. create or replace view my_view as
  2. select
  3. Part1 as part_1
  4. , Part2 as part_2
  5. , Column1 as column_1
  6. , Column2 as column_2
  7. from read_parquet(
  8. [
  9. 's3://my-bucket/path/to/part1=abc/part2=123/000.parquet',
  10. 's3://my-bucket/path/to/part1=def/part2=456/000.parquet',
  11. 's3://my-bucket/path/to/part1=ghi/part2=789/000.parquet'
  12. ],
  13. hive_partitioning=1)

然后执行一个查询,如下所示:
select count(*) from my_view where part1 = 'abc' and part2 = '123'
我希望DuckDB使用下推 predicate 来只读s3://my-bucket/path/to/part1=abc/part2=123/000.parquet文件。相反,我看到Chrome调试工具网络选项卡读取所有三个文件。

1bqhqjot

1bqhqjot1#

我想我知道了。S3前缀区分大小写。改变观点似乎已经为我解决了这个问题。

  1. create or replace view my_view as
  2. select
  3. part1 as part_1
  4. , part2 as part_2
  5. , Column1 as column_1
  6. , Column2 as column_2
  7. from read_parquet(
  8. [
  9. 's3://my-bucket/path/to/part1=abc/part2=123/000.parquet',
  10. 's3://my-bucket/path/to/part1=def/part2=456/000.parquet',
  11. 's3://my-bucket/path/to/part1=ghi/part2=789/000.parquet'
  12. ],
  13. hive_partitioning=1)

相关问题