Skip to content

[SPARK-19833][SQL]remove SQLConf.HIVE_VERIFY_PARTITION_PATH, always return empty when the location does not exists - #17176

Closed
windpiger wants to merge 6 commits into
apache:masterfrom
windpiger:removeHiveVerfiyPath
Closed

[SPARK-19833][SQL]remove SQLConf.HIVE_VERIFY_PARTITION_PATH, always return empty when the location does not exists#17176
windpiger wants to merge 6 commits into
apache:masterfrom
windpiger:removeHiveVerfiyPath

Conversation

@windpiger

@windpigerwindpiger commented Mar 6, 2017

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

In SPARK-5068, we introduce a SQLConf spark.sql.hive.verifyPartitionPath,
if it is set to true, it will avoid the task failed when the patition location does not exists in the filesystem.

this situation should always return emtpy and don't lead to the task failed, here we remove this conf.

And the function verifyPartitionPath has a bug ,that if the partition path is custom path

it will still do filter for all partition path in the parameter partitionToDeserializer,
it will scan the path which does not belong to the table ,e.g. custom path is /root/a
and the partitionSpec is b=1/c=2, this will lead to scan / because of the getPathPatternByPath

How was this patch tested?

modify a test case

…eturn empty when the location does not exists
@SparkQA

Copy link
Copy Markdown

Test build #73991 has finished for PR 17176 at commit 95aa931.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@windpiger
windpigerforce-pushed the removeHiveVerfiyPath branch from 4bb0e28 to 8128567CompareMarch 6, 2017 12:05
}
// convert /demo/data/year/month/day to /demo/data/*/*/*/
def getPathPatternByPath(parNum: Int, tempPath: Path, partitionName: String): String = {
// if the partition path does not end with partition name, we should not

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the partition location has been altered to another location, we should not do this pattern, or we will list pattern files which does not belong to the partition

@SparkQA

Copy link
Copy Markdown

Test build #73998 has finished for PR 17176 at commit 8128567.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #73992 has finished for PR 17176 at commit 4bb0e28.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@windpiger

Copy link
Copy Markdown
ContributorAuthor

retest this please

@SparkQA

Copy link
Copy Markdown

Test build #74016 has finished for PR 17176 at commit 8128567.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@windpiger

Copy link
Copy Markdown
ContributorAuthor

why jenkins failed...

@SparkQA

Copy link
Copy Markdown

Test build #74072 has finished for PR 17176 at commit 22b1f53.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

def verifyPartitionPath(
partitionToDeserializer: Map[HivePartition, Class[_ <: Deserializer]]):
Map[HivePartition, Class[_ <: Deserializer]] = {
if (!sparkSession.sessionState.conf.verifyPartitionPath) {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after this pr https://github.com/apache/spark/pull/17187, read hive table which does not use stored by will not use HiveTableScanExec.

this function has a bug ,that if the partition path is custom path

  1. it will still do filter for all partition path in the parameter partitionToDeserializer,
  2. it will scan the path which does not belong to the table ,e.g. custom path is /root/a
    and the partitionSpec is b=1/c=2, this will lead to scan / because of the getPathPatternByPath

@SparkQA

Copy link
Copy Markdown

Test build #74106 has finished for PR 17176 at commit 262e2f2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #74107 has finished for PR 17176 at commit 3a15e5d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile

Copy link
Copy Markdown
Member

@windpiger If you do not have a bandwidth to continue it, how about closing it now?

case (partition, partDeserializer) =>
val partPath = partition.getDataLocation
val fs = partPath.getFileSystem(hadoopConf)
fs.exists(partPath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each partition sending an RPC request to the NameNode can result in poor performance

@HyukjinKwonHyukjinKwon mentioned this pull request Nov 11, 2018
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closesapache#21766Closesapache#21679Closesapache#21161Closesapache#20846Closesapache#19434Closesapache#18080Closesapache#17648Closesapache#17169
Add:
Closesapache#22813Closesapache#21994Closesapache#22005Closesapache#22463
Add:
Closesapache#15899
Add:
Closesapache#22539Closesapache#21868Closesapache#21514Closesapache#21402Closesapache#21322Closesapache#21257Closesapache#20163Closesapache#19691Closesapache#18697Closesapache#18636Closesapache#17176Closesapache#23001 from wangyum/CloseStalePRs.
Authored-by: Yuming Wang <yumwang@ebay.com>
Signed-off-by: hyukjinkwon <gurwls223@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@windpiger@SparkQA@gatorsmile@barrenlake