Skip to content

Conversation

@parthchandra
Copy link
Contributor

Which issue does this PR close?

Closes #876 .

Rationale for this change

Moves configuration options of the parallel reader into CometConf and adds documentation so that end users can easily understand the configuration of the reader.

How are these changes tested?

Existing unit test

public void testWriteReadMergeScanRange() throws Throwable {
Configuration conf = new Configuration();
conf.set(ReadOptions.COMET_IO_MERGE_RANGES, Boolean.toString(true));
conf.set(CometConf.COMET_IO_MERGE_RANGES().key(), Boolean.toString(true));
Copy link
Member

Choose a reason for hiding this comment

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

This test is setting the config values in a Hadoop Configuration still, and not setting them in the Spark config. Would it make sense to update the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no spark context in this test. I've added a new test with the configuration set thru the spark config

public Builder(Configuration conf) {
this.conf = conf;
this.parallelIOEnabled =
conf.getBoolean(
Copy link
Member

Choose a reason for hiding this comment

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

This is reading from the Hadoop conf. If I set the new configs on my Spark context, how would they get propagated to the Hadoop conf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spark sql copies over configs that are not from spark into the hadoop config when the sql context is created. There are other settings that also use this ( e.g. COMET_USE_LAZY_MATERIALIZATION, COMET_SCAN_PREFETCH_ENABLED)

withSQLConf(
CometConf.COMET_BATCH_SIZE.key -> batchSize.toString,
CometConf.COMET_IO_MERGE_RANGES.key -> "true",
CometConf.COMET_IO_MERGE_RANGES_DELTA.key -> mergeRangeDelta.toString) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to test that this config is actually making into ReadOptions? If I comment out all of the code in ReadOptions that reads these configs, the test still passes. Perhaps we just need a specific test to show that setting the config on a Spark context causes a change to the ReadOptions?

Copy link
Member

Choose a reason for hiding this comment

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

I added some debug logging and I do see that it is working correctly, but would be good to have a test to confirm (and prevent regressions)

test is setting COMET_IO_MERGE_RANGES_DELTA = 1048576
ReadOptions ioMergeRangesDelta = 1048576
test is setting COMET_IO_MERGE_RANGES_DELTA = 1024
ReadOptions ioMergeRangesDelta = 1024

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an additional check for the config. The configuration passed in to read options is not accessible but I tried to simulate the next best thing. See if that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Parth. LGTM. Looks like you need to run make format to fix some import ordering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @andygrove. Fixed style.

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM with some comments on testing.

@andygrove andygrove merged commit 0667c60 into apache:main Oct 7, 2024
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

Closes #.

## Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

## What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

```
cb3e977 perf: Add experimental feature to replace SortMergeJoin with ShuffledHashJoin (apache#1007)
3df9d5c fix: Make comet-git-info.properties optional (apache#1027)
4033687 chore: Reserve memory for native shuffle writer per partition (apache#1022)
bd541d6 (public/main) remove hard-coded version number from Dockerfile (apache#1025)
e3ac6cf feat: Implement bloom_filter_agg (apache#987)
8d097d5 (origin/main) chore: Revert "chore: Reserve memory for native shuffle writer per partition (apache#988)" (apache#1020)
591f45a chore: Bump arrow-rs to 53.1.0 and datafusion (apache#1001)
e146cfa chore: Reserve memory for native shuffle writer per partition (apache#988)
abd9f85 fix: Fallback to Spark if named_struct contains duplicate field names (apache#1016)
22613e9 remove legacy comet-spark-shell (apache#1013)
d40c802 clarify that Maven central only has jars for Linux (apache#1009)
837c256 docs: Various documentation improvements (apache#1005)
0667c60 chore: Make parquet reader options Comet options instead of Hadoop options (apache#968)
0028f1e fix: Fallback to Spark if scan has meta columns (apache#997)
b131cc3 feat: Support `GetArrayStructFields` expression (apache#993)
3413397 docs: Update tuning guide (apache#995)
afd28b9 Quality of life fixes for easier hacking (apache#982)
18150fb chore: Don't transform the HashAggregate to CometHashAggregate if Comet shuffle is disabled (apache#991)
a1599e2 chore: Update for 0.3.0 release, prepare for 0.4.0 development (apache#970)
```

## How are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
Sign up for free to 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.

Add documentation for COMET_PARQUET_PARALLEL_IO_ENABLED

2 participants