-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-29781: [C++][Parquet] Switch to use compliant nested types by default #35146
GH-29781: [C++][Parquet] Switch to use compliant nested types by default #35146
Conversation
@@ -819,8 +819,7 @@ class PARQUET_EXPORT ArrowWriterProperties { | |||
coerce_timestamps_unit_(::arrow::TimeUnit::SECOND), | |||
truncated_timestamps_allowed_(false), | |||
store_schema_(false), | |||
// TODO: At some point we should flip this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This is disabled by default, but will be enabled by default in future.
Should we change this in Loc 880?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line 320 in the parquet.rst doc should also be changed.
std::shared_ptr<ArrowWriterProperties> arrow_props = ArrowWriterProperties::Builder()
.enable_deprecated_int96_timestamps() // default False
->store_schema() // default False
->enable_compliant_nested_types() // default False
->build();
4d0b91d
to
72b4c67
Compare
72b4c67
to
564000c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public abstract class ConversionPatterns {
static final String MAP_REPEATED_NAME = "key_value";
private static final String ELEMENT_NAME = "element";
Go through the Java code, seems that it also uses "element". LGTM
In C++, code shows |
The rules were laid out earlier here: Before this PR I did work to make sure that the Arrow C++ implementation (1) didn't care about the field names in equality comparison (PR) and (2) could cheaply cast between types that differed only in field names (PR). |
Thanks! So, this flag could make converting and reading a bit cheaper? |
Is it time to revive this PR and check it in? @wjones127 |
8f28f2a
to
0ea421d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! cc @pitrou
Co-authored-by: Antoine Pitrou <[email protected]>
Benchmark runs are scheduled for baseline = 1624d5a and contender = e324f9a. e324f9a is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
['Python', 'R'] benchmarks have high level of regressions. |
…y default (apache#35146) ### Rationale for this change This has been a long-standing TODO. ### What changes are included in this PR? ### Are these changes tested? ### Are there any user-facing changes? **This PR includes breaking changes to public APIs.** * Closes: apache#29781 Lead-authored-by: Will Jones <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
…y default (apache#35146) ### Rationale for this change This has been a long-standing TODO. ### What changes are included in this PR? ### Are these changes tested? ### Are there any user-facing changes? **This PR includes breaking changes to public APIs.** * Closes: apache#29781 Lead-authored-by: Will Jones <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
…compliant nested types (#2428) This solves some of our flaky unit tests that try to read a Ray dataset tensor type under a Pyarrow version that does not properly serialize it. Adds a new exception when we detect this issue, and also updates our pyarrow dependencies to 13.0.0. I also found a separate bug upon upgrading to pyarrow, where versions >= 13.0.0 will use compliant Parquet nested type names by default (see apache/arrow#35146), which would then cause a discrepancy between the Parquet and Arrow schemas for extension types. This would lead to incorrect conversion from Parquet to Arrow when we would read a file. This PR disables that explicitly. Finally I also added a `coerce_temporal_nanoseconds` parameter to `to_pandas` to revert it to its pre pyarrow>=13.0.0 behavior, which makes the sql integration tests pass again Confirmed to raise proper error in local testing
Rationale for this change
This has been a long-standing TODO.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?
This PR includes breaking changes to public APIs.