[ https://issues.apache.org/jira/browse/SPARK-22680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282248#comment-16282248 ]
Nan Zhu commented on SPARK-22680: --------------------------------- how you observed that spark scans all partitions? I tried to reproduce but no luck table structure {code} zhunan@sparktest:~/testdata1$ ls count1=1 count1=2 count1=3 _SUCCESS {code} query: select * from table1 where count1 = 4 I can see the log shows 17/12/07 17:57:51 INFO PrunedInMemoryFileIndex: Selected 0 partitions out of 0, pruned 0 partitions. 17/12/07 17:57:51 TRACE PrunedInMemoryFileIndex: Selected files after partition pruning: No file was selected > SparkSQL scan all partitions when the specified partitions are not exists in > parquet formatted table > ---------------------------------------------------------------------------------------------------- > > Key: SPARK-22680 > URL: https://issues.apache.org/jira/browse/SPARK-22680 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.0.2, 2.2.0 > Environment: spark2.0.2 spark2.2.0 > Reporter: Xiaochen Ouyang > > 1. spark-sql --master local[2] > 2. create external table test (id int,name string) partitioned by (country > string,province string, day string,hour int) stored as parquet localtion > '/warehouse/test'; > 3.produce data into table test > 4. select count(1) from test where country = '185' and province = '021' and > day = '2017-11-12' and hour = 10; if the 4 filter conditions are not exists > in HDFS and MetaStore[mysql] , this sql will scan all partitions in table test -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org