You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2016/08/02 04:40:48 UTC

[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/14450

    [SPARK-16847][SQL] Prevent to potentially read corrupt statstics on binary in Parquet a VectorizedReader

    ## What changes were proposed in this pull request?
    
    it is still possible to read corrupt Parquet's statistics.
    This problem was found in [PARQUET-251](https://issues.apache.org/jira/browse/PARQUET-251) and we disabled filter pushdown on binary columns in Spark before.
    
    We enabled this after upgrading Parquet but it seems there are potential incompatibility for Parquet files written in lower Spark versions.
    
    Currently, this does not affect Parquet standard API. However, In Spark, we implemented a vectorized reader, separately with Parquet's standard API. For standard API, this is being handled but not in the vectorized reader.
    
    This will be okay in Spark 2.0 because we don't use the statistics for not in vectorized reader, https://github.com/apache/spark/pull/13701. However, if we support this, we will meet this potential incompatibility. 
    
    It is okay to just pass `FileMetaData`. This is being handled in parquet-mr (See https://github.com/apache/parquet-mr/commit/e3b95020f777eb5e0651977f654c1662e3ea1f29)
    
    ## How was this patch tested?
    
    N/A


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/spark SPARK-16847

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14450.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14450
    
----
commit 3c461117852c86eae631b06cacfd72773653083c
Author: hyukjinkwon <gu...@gmail.com>
Date:   2016-08-02T04:31:04Z

    Prevent to potentially read corrupt statstics on binary in Parquet via VectorizedReader

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14450#discussion_r73632453
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java ---
    @@ -204,7 +205,8 @@ protected void initialize(String path, List<String> columns) throws IOException
           }
         }
         this.sparkSchema = new ParquetSchemaConverter(config).convert(requestedSchema);
    -    this.reader = new ParquetFileReader(config, file, blocks, requestedSchema.getColumns());
    +    this.reader = new ParquetFileReader(
    +        config, footer.getFileMetaData(), file, blocks, requestedSchema.getColumns());
         for (BlockMetaData block : blocks) {
    --- End diff --
    
    Hm.. I don't think we should make a separate function for few duplicated lines.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14450#discussion_r73595317
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java ---
    @@ -140,7 +140,8 @@ public void initialize(InputSplit inputSplit, TaskAttemptContext taskAttemptCont
         String sparkRequestedSchemaString =
             configuration.get(ParquetReadSupport$.MODULE$.SPARK_ROW_REQUESTED_SCHEMA());
         this.sparkSchema = StructType$.MODULE$.fromString(sparkRequestedSchemaString);
    -    this.reader = new ParquetFileReader(configuration, file, blocks, requestedSchema.getColumns());
    +    this.reader = new ParquetFileReader(
    +        configuration, footer.getFileMetaData(), file, blocks, requestedSchema.getColumns());
         for (BlockMetaData block : blocks) {
    --- End diff --
    
    Spaces around the colon are definitely canonical


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/14450


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    **[Test build #63104 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63104/consoleFull)** for PR 14450 at commit [`3c46111`](https://github.com/apache/spark/commit/3c461117852c86eae631b06cacfd72773653083c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    **[Test build #63145 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63145/consoleFull)** for PR 14450 at commit [`50cc80c`](https://github.com/apache/spark/commit/50cc80c8c63f2cbf87d0898f8d4b30c724336e2c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

Posted by jaceklaskowski <gi...@git.apache.org>.
Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14450#discussion_r73511032
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java ---
    @@ -204,7 +205,8 @@ protected void initialize(String path, List<String> columns) throws IOException
           }
         }
         this.sparkSchema = new ParquetSchemaConverter(config).convert(requestedSchema);
    -    this.reader = new ParquetFileReader(config, file, blocks, requestedSchema.getColumns());
    +    this.reader = new ParquetFileReader(
    +        config, footer.getFileMetaData(), file, blocks, requestedSchema.getColumns());
         for (BlockMetaData block : blocks) {
    --- End diff --
    
    Same here. BTW, code duplication?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63104/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    This will be a legitimate change because this replaces the deprecated usage of constructor. Please let me cc @liancheng and @srowen as well as it is also partly about building.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Merged to master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Oh, I think this should not be backported to 2.0 and 1.x. In current releases, this is all being manually prevented in Spark itself (in [here](https://github.com/apache/spark/blob/branch-2.0/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala#L171-L180)). Also, they use Parquet 1.7.0/1.6.0rc3 but this was fixed in Parquet 1.8.0 (assuming from [PARQUET-251](https://issues.apache.org/jira/browse/PARQUET-251)).
    
    In master branch, this safeguard was removed with upgrading Parquet to 1.8.1 in [SPARK-9876](https://issues.apache.org/jira/browse/SPARK-9876). So, I believe this PR is only related with the current master.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63145/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #14450: [SPARK-16847][SQL] Prevent to potentially read co...

Posted by jaceklaskowski <gi...@git.apache.org>.
Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14450#discussion_r73510962
  
    --- Diff: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java ---
    @@ -140,7 +140,8 @@ public void initialize(InputSplit inputSplit, TaskAttemptContext taskAttemptCont
         String sparkRequestedSchemaString =
             configuration.get(ParquetReadSupport$.MODULE$.SPARK_ROW_REQUESTED_SCHEMA());
         this.sparkSchema = StructType$.MODULE$.fromString(sparkRequestedSchemaString);
    -    this.reader = new ParquetFileReader(configuration, file, blocks, requestedSchema.getColumns());
    +    this.reader = new ParquetFileReader(
    +        configuration, footer.getFileMetaData(), file, blocks, requestedSchema.getColumns());
         for (BlockMetaData block : blocks) {
    --- End diff --
    
    While we're at it, are the spaces around `:` necessary? (it's been a while since I developed in Java so I might be wrong).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    **[Test build #63104 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63104/consoleFull)** for PR 14450 at commit [`3c46111`](https://github.com/apache/spark/commit/3c461117852c86eae631b06cacfd72773653083c).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    **[Test build #63145 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63145/consoleFull)** for PR 14450 at commit [`50cc80c`](https://github.com/apache/spark/commit/50cc80c8c63f2cbf87d0898f8d4b30c724336e2c).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #14450: [SPARK-16847][SQL] Prevent to potentially read corrupt s...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/14450
  
    @HyukjinKwon to be sure, this is something you think should be back-ported to 2.0? it doesn't affect 1.x right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org