You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ongchi (via GitHub)" <gi...@apache.org> on 2023/10/05 07:35:02 UTC
[PR] Make parquet an option [arrow-datafusion]
ongchi opened a new pull request, #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745
## 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 #123` indicates that this PR will close issue #123.
-->
Closes #7653
## 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.
-->
## 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)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet an option [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1751399359
Thanks @ongchi 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `parquet` feature flag, enabled by default, and make parquet conditional [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1779959155
Flagging as an API change because if someone has `--no-default-features` in their crate, this change means they have to enable the `parquet` feature
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet support optional under a feature flag [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1775880933
Thanks @ongchi -- I have this on my list to review, but I am struggling to find time to do so (it is hard to find time to review large PRs as they need non trivial contiguous time). I hope to find such time over the next day or two
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet support optional under a feature flag [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1767205413
This PR has somehow managed to accumulate a bunch of merge conflicts
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet support optional under a feature flag [arrow-datafusion]
Posted by "ongchi (via GitHub)" <gi...@apache.org>.
ongchi commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1775070798
I have already reviewed the changes after these commits and resolved all conflicts. Hopefully, this will relieve the burden of reviewing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `parquet` feature flag, enabled by default, and make parquet conditional [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#discussion_r1372248425
##########
datafusion/core/src/datasource/listing/table.rs:
##########
@@ -150,6 +151,7 @@ impl ListingTableConfig {
FileType::JSON => Arc::new(
JsonFormat::default().with_file_compression_type(file_compression_type),
),
+ #[cfg(feature = "parquet")]
Review Comment:
It is strange to me that AVRO isn't `#[cfg`]d the same way as `PARQUET` 🤔
##########
datafusion/core/src/dataframe/parquet.rs:
##########
@@ -0,0 +1,162 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use datafusion_common::file_options::parquet_writer::{
Review Comment:
This is a nice refactor to isolate the parquet related functions in a separate module. 👍
##########
datafusion/core/src/execution/context/avro.rs:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
Review Comment:
👨🍳 👌 - very nice
##########
datafusion/core/src/dataframe/parquet.rs:
##########
@@ -0,0 +1,162 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use datafusion_common::file_options::parquet_writer::{
Review Comment:
This is a nice refactor to isolate the parquet related functions in a separate module. 👍
##########
datafusion/core/src/datasource/physical_plan/mod.rs:
##########
@@ -23,17 +23,20 @@ mod csv;
mod file_scan_config;
mod file_stream;
mod json;
+#[cfg(feature = "parquet")]
pub mod parquet;
pub(crate) use self::csv::plan_to_csv;
pub use self::csv::{CsvConfig, CsvExec, CsvOpener};
-pub(crate) use self::file_scan_config::PartitionColumnProjector;
pub(crate) use self::json::plan_to_json;
+#[cfg(feature = "parquet")]
Review Comment:
We can probably simplify the code a little as a follow on PR by removing this `pub(crate) use` and using it directly in the parquet module
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -16,6 +16,13 @@
// under the License.
//! [`SessionContext`] contains methods for registering data sources and executing queries
+
+mod avro;
Review Comment:
It would be neat (again as a follow on PR) to make avro support also conditionalized
##########
datafusion/core/src/physical_optimizer/enforce_distribution.rs:
##########
@@ -1308,16 +1310,16 @@ fn ensure_distribution(
// When `repartition_file_scans` is set, leverage source operators
// (`ParquetExec`, `CsvExec` etc.) to increase parallelism at the source.
if repartition_file_scans {
+ #[cfg(feature = "parquet")]
Review Comment:
It would be nice to remove this `#[cfg` as well as the special case handling of ParquetExec in the enforce distribution rule. Not in this PR, but as a follow on. I will file a ticket
##########
datafusion/core/src/datasource/listing/table.rs:
##########
@@ -150,6 +151,7 @@ impl ListingTableConfig {
FileType::JSON => Arc::new(
JsonFormat::default().with_file_compression_type(file_compression_type),
),
+ #[cfg(feature = "parquet")]
Review Comment:
It is strange to me that AVRO isn't `#[cfg`]d the same way as `PARQUET` 🤔
##########
datafusion/core/src/execution/context/avro.rs:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
Review Comment:
👨🍳 👌 - very nice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet an option [arrow-datafusion]
Posted by "ongchi (via GitHub)" <gi...@apache.org>.
ongchi commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1752261205
All checks in CI have passed with the current modification. I am going to spend some time to see if it's possible to extract some common logic on the file format.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make parquet an option [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745#issuecomment-1752982306
>
All checks in CI have passed with the current modification. I am going to spend some time to see if it's possible to extract some common logic on the file format.
Thank you -- that sounds like a great improvement
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add `parquet` feature flag, enabled by default, and make parquet conditional [arrow-datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #7745:
URL: https://github.com/apache/arrow-datafusion/pull/7745
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org