-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-37220][SQL] Do not split input file for Parquet reader with aggregate push down #34498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,11 +92,6 @@ case class ParquetPartitionReaderFactory( | |
| ParquetFooterReader.readFooter(conf, filePath, SKIP_ROW_GROUPS) | ||
| } else { | ||
| // For aggregate push down, we will get max/min/count from footer statistics. | ||
| // We want to read the footer for the whole file instead of reading multiple | ||
| // footers for every split of the file. Basically if the start (the beginning of) | ||
| // the offset in PartitionedFile is 0, we will read the footer. Otherwise, it means | ||
| // that we have already read footer for that file, so we will skip reading again. | ||
| if (file.start != 0) return null | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@HyukjinKwon - I think we are in the same page based on your latest comment, but just to be noisy here in case anything is missing. Before this PR, when a single file is split into multiple splits across multiple tasks, we have the logic here to only process the split of file if |
||
| ParquetFooterReader.readFooter(conf, filePath, NO_FILTER) | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,11 @@ case class ParquetScan( | |
| pushedAggregate: Option[Aggregation] = None, | ||
| partitionFilters: Seq[Expression] = Seq.empty, | ||
| dataFilters: Seq[Expression] = Seq.empty) extends FileScan { | ||
| override def isSplitable(path: Path): Boolean = true | ||
| override def isSplitable(path: Path): Boolean = { | ||
| // If aggregate is pushed down, only the file footer will be read once, | ||
| // so file should not be split across multiple tasks. | ||
| pushedAggregate.isEmpty | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, okay. Got it now. |
||
| } | ||
|
|
||
| override def readSchema(): StructType = { | ||
| // If aggregate is pushed down, schema has already been pruned in `ParquetScanBuilder` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.