You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/18 16:18:50 UTC

[GitHub] [arrow-datafusion] lvheyang opened a new pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

lvheyang opened a new pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749


   # 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 #723.
   
   but it is just the first step, we need another pr to close the issue.
   
    # 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.  
   -->
   
   Add an option in ExecutionConfig, to help users disable/enable parquet pruning to work around the features' bug
   
   # 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 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



[GitHub] [arrow-datafusion] lvheyang commented on a change in pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
lvheyang commented on a change in pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749#discussion_r671872318



##########
File path: datafusion/src/datasource/parquet.rs
##########
@@ -38,11 +38,22 @@ pub struct ParquetTable {
     schema: SchemaRef,
     statistics: Statistics,
     max_concurrency: usize,
+    enable_pruning: bool,
 }
 
 impl ParquetTable {
     /// Attempt to initialize a new `ParquetTable` from a file path.
     pub fn try_new(path: impl Into<String>, max_concurrency: usize) -> Result<Self> {
+        ParquetTable::try_new_with_pruning_config(path, max_concurrency, true)
+    }
+
+    /// Attempt to initialize a new `ParquetTable` from a file path. And enable or
+    /// disable the parquet pruning features.
+    pub fn try_new_with_pruning_config(

Review comment:
       Here I'm not sure if adding the function is a good choice. 
   
   My concern is, it is a public function, it may last a long time, and many users will rely on it. But the `enable_pruning` in the signature is somehow temporal, we don't want it to last for a long time.
   
   So I have another thought, replace this function with `try_new_with_config(path: impl Into<String>,, execution_config: ExecutionConfig)`. I think it's a better option, but it will introduce the dependency of `execution::context` module which I think is the top-level module. It seems a little weird. 
   
   Or we can add a function like `try_new_with_config(path: impl Into<String>, conf: ParquetConfig)` with struct `ParquetConfig`. I think it's should be more flexible, the interface would not change if we want to abandon this option.




-- 
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



[GitHub] [arrow-datafusion] alamb merged pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749


   


-- 
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



[GitHub] [arrow-datafusion] alamb merged pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749


   


-- 
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



[GitHub] [arrow-datafusion] lvheyang commented on a change in pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
lvheyang commented on a change in pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749#discussion_r671946785



##########
File path: datafusion/src/datasource/parquet.rs
##########
@@ -38,11 +38,22 @@ pub struct ParquetTable {
     schema: SchemaRef,
     statistics: Statistics,
     max_concurrency: usize,
+    enable_pruning: bool,
 }
 
 impl ParquetTable {
     /// Attempt to initialize a new `ParquetTable` from a file path.
     pub fn try_new(path: impl Into<String>, max_concurrency: usize) -> Result<Self> {
+        ParquetTable::try_new_with_pruning_config(path, max_concurrency, true)
+    }
+
+    /// Attempt to initialize a new `ParquetTable` from a file path. And enable or
+    /// disable the parquet pruning features.
+    pub fn try_new_with_pruning_config(

Review comment:
       @houqp Thank you for your advice. I think it is more elegant than my first version, and I've modified it to this style. 
   




-- 
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



[GitHub] [arrow-datafusion] lvheyang commented on a change in pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
lvheyang commented on a change in pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749#discussion_r671872318



##########
File path: datafusion/src/datasource/parquet.rs
##########
@@ -38,11 +38,22 @@ pub struct ParquetTable {
     schema: SchemaRef,
     statistics: Statistics,
     max_concurrency: usize,
+    enable_pruning: bool,
 }
 
 impl ParquetTable {
     /// Attempt to initialize a new `ParquetTable` from a file path.
     pub fn try_new(path: impl Into<String>, max_concurrency: usize) -> Result<Self> {
+        ParquetTable::try_new_with_pruning_config(path, max_concurrency, true)
+    }
+
+    /// Attempt to initialize a new `ParquetTable` from a file path. And enable or
+    /// disable the parquet pruning features.
+    pub fn try_new_with_pruning_config(

Review comment:
       Here I'm not sure if adding the function is a good choice. 
   
   My concern is, it is a public function, it may last a long time, and many users will rely on it. But the `enable_pruning` in the signature is somehow temporal, we don't want it to last for a long time.
   
   So I have another thought, replace this function with `try_new_with_config(path: impl Into<String>,, execution_config: ExecutionConfig)`. I think it's a better option, but it will introduce the dependency of `execution::context` module which I think is the top-level module. It seems a little weird. 
   
   Or we can add a function like `try_new_with_config(path: impl Into<String>, conf: ParquetConfig)` with struct `ParquetConfig`. I think it's should be more flexible, the interface would not change if we want to abandon this option.
   
   If there are no other considerations, I will fix it by the 3rd method tomorrow.




-- 
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



[GitHub] [arrow-datafusion] alamb merged pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749


   


-- 
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



[GitHub] [arrow-datafusion] lvheyang commented on a change in pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
lvheyang commented on a change in pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749#discussion_r671872318



##########
File path: datafusion/src/datasource/parquet.rs
##########
@@ -38,11 +38,22 @@ pub struct ParquetTable {
     schema: SchemaRef,
     statistics: Statistics,
     max_concurrency: usize,
+    enable_pruning: bool,
 }
 
 impl ParquetTable {
     /// Attempt to initialize a new `ParquetTable` from a file path.
     pub fn try_new(path: impl Into<String>, max_concurrency: usize) -> Result<Self> {
+        ParquetTable::try_new_with_pruning_config(path, max_concurrency, true)
+    }
+
+    /// Attempt to initialize a new `ParquetTable` from a file path. And enable or
+    /// disable the parquet pruning features.
+    pub fn try_new_with_pruning_config(

Review comment:
       Here I'm not sure if adding the function is a good choice. 
   
   My concern is, it is a public function, there may be many users who rely on it. But the `enable_pruning` in the signature is somehow temporal, we don't want it to last for a long time.
   
   So I have another thought, replace this function with `try_new_with_config(path: impl Into<String>,, execution_config: ExecutionConfig)`. I think it's a better option, but it will introduce the dependency of `execution::context` module which I think is the top-level module. It seems a little weird. 
   
   I'm not sure if the second method is acceptable?




-- 
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



[GitHub] [arrow-datafusion] houqp commented on a change in pull request #749: #723 Datafusion add option in ExecutionConfig to enable/disable parquet pruning

Posted by GitBox <gi...@apache.org>.
houqp commented on a change in pull request #749:
URL: https://github.com/apache/arrow-datafusion/pull/749#discussion_r671878480



##########
File path: datafusion/src/datasource/parquet.rs
##########
@@ -38,11 +38,22 @@ pub struct ParquetTable {
     schema: SchemaRef,
     statistics: Statistics,
     max_concurrency: usize,
+    enable_pruning: bool,
 }
 
 impl ParquetTable {
     /// Attempt to initialize a new `ParquetTable` from a file path.
     pub fn try_new(path: impl Into<String>, max_concurrency: usize) -> Result<Self> {
+        ParquetTable::try_new_with_pruning_config(path, max_concurrency, true)
+    }
+
+    /// Attempt to initialize a new `ParquetTable` from a file path. And enable or
+    /// disable the parquet pruning features.
+    pub fn try_new_with_pruning_config(

Review comment:
       how about adopting the same builder design you went with `pub fn with_parquet_pruning`? then you can initialize it as:
   
   ```rust
               ParquetTable::try_new(
                   filename,
                   m.config.concurrency,
               )?.with_enable_pruning(m.config.parquet_pruning)
   ```
   
   




-- 
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