You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by vdiravka <gi...@git.apache.org> on 2016/12/09 21:49:32 UTC

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

GitHub user vdiravka opened a pull request:

    https://github.com/apache/drill/pull/687

    DRILL-4996: Parquet Date auto-correction is not working in auto-parti\u2026

    \u2026tioned parquet files generated by drill-1.6
    
    - Changed detection approach of corrupted date values for the case, when parquet files are generated by drill:
      the corruption status is determined by looking at the min/max values in the metadata;
    - Appropriate refactoring of TestCorruptParquetDateCorrection.

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

    $ git pull https://github.com/vdiravka/drill DRILL-4996

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

    https://github.com/apache/drill/pull/687.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 #687
    
----
commit 22f4c3dcbe00d47055185d802e88fecaff0d252d
Author: Vitalii Diravka <vi...@gmail.com>
Date:   2016-12-09T08:00:48Z

    DRILL-4996: Parquet Date auto-correction is not working in auto-partitioned parquet files generated by drill-1.6
    - Changed detection approach of corrupted date values for the case, when parquet files are generated by drill:
      the corruption status is determined by looking at the min/max values in the metadata;
    - Appropriate refactoring of TestCorruptParquetDateCorrection.

----


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

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

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

    https://github.com/apache/drill/pull/687#discussion_r93028681
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestCorruptParquetDateCorrection.java ---
    @@ -273,26 +241,28 @@ public void testReadPartitionedOnCorruptedDates_UserDisabledCorrection() throws
       public void testCorruptValDetectionDuringPruning() throws Exception {
         try {
           for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`" +
    -            " where date_col = date '1970-01-01'";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(1970, 1, 1, 0, 0))
    -            .go();
    +        for (String table : new String[]{CORRUPTED_PARTITIONED_DATES_1_2_PATH, CORRUPTED_PARTITIONED_DATES_1_4_0_PATH}) {
    --- End diff --
    
    Answered above.


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

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

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

    https://github.com/apache/drill/pull/687#discussion_r92883043
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestCorruptParquetDateCorrection.java ---
    @@ -273,26 +241,28 @@ public void testReadPartitionedOnCorruptedDates_UserDisabledCorrection() throws
       public void testCorruptValDetectionDuringPruning() throws Exception {
         try {
           for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`" +
    -            " where date_col = date '1970-01-01'";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(1970, 1, 1, 0, 0))
    -            .go();
    +        for (String table : new String[]{CORRUPTED_PARTITIONED_DATES_1_2_PATH, CORRUPTED_PARTITIONED_DATES_1_4_0_PATH}) {
    --- End diff --
    
    The same. We always keep indent the same.


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

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

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

    https://github.com/apache/drill/pull/687#discussion_r93028597
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestCorruptParquetDateCorrection.java ---
    @@ -201,68 +203,34 @@ public void testCorrectDatesAndExceptionWhileParsingCreatedBy() throws Exception
             .go();
       }
     
    -  /**
    -   * Test reading a directory full of partitioned parquet files with dates, these files have a drill version
    -   * number of 1.4.0 in their footers, so we can be certain they are corrupt. The option to disable the
    -   * correction is passed, but it will not change the result in the case where we are certain correction
    -   * is needed. For more info see DRILL-4203.
    -   */
    -  @Test
    -  public void testReadPartitionedOnCorruptedDates() throws Exception {
    -    try {
    -      for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_4_0_PATH + "`" +
    -                "(type => 'parquet', autoCorrectCorruptDates => false))")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_4_0_PATH + "` " +
    -            "(type => 'parquet', autoCorrectCorruptDates => false))" + " where date_col = date '1970-01-01'";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(1970, 1, 1, 0, 0))
    -            .go();
    -      }
    -    } finally {
    -      test("alter session reset all");
    -    }
    -  }
     
       @Test
       public void testReadPartitionedOnCorruptedDates_UserDisabledCorrection() throws Exception {
         try {
           for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`" +
    -                "(type => 'parquet', autoCorrectCorruptDates => false))")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addCorruptedDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "` " +
    -            "(type => 'parquet', autoCorrectCorruptDates => false))" + " where date_col = cast('15334-03-17' as date)";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(15334, 03, 17, 0, 0))
    -            .go();
    +        for (String table : new String[]{CORRUPTED_PARTITIONED_DATES_1_2_PATH, CORRUPTED_PARTITIONED_DATES_1_4_0_PATH}) {
    --- End diff --
    
    It is necessary to keep indent (211 line) after `try` block and then (212 line) after `for` block.


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

[GitHub] drill issue #687: DRILL-4996: Parquet Date auto-correction is not working in...

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

    https://github.com/apache/drill/pull/687
  
    +1


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

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

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

    https://github.com/apache/drill/pull/687#discussion_r92882778
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestCorruptParquetDateCorrection.java ---
    @@ -201,68 +203,34 @@ public void testCorrectDatesAndExceptionWhileParsingCreatedBy() throws Exception
             .go();
       }
     
    -  /**
    -   * Test reading a directory full of partitioned parquet files with dates, these files have a drill version
    -   * number of 1.4.0 in their footers, so we can be certain they are corrupt. The option to disable the
    -   * correction is passed, but it will not change the result in the case where we are certain correction
    -   * is needed. For more info see DRILL-4203.
    -   */
    -  @Test
    -  public void testReadPartitionedOnCorruptedDates() throws Exception {
    -    try {
    -      for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_4_0_PATH + "`" +
    -                "(type => 'parquet', autoCorrectCorruptDates => false))")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_4_0_PATH + "` " +
    -            "(type => 'parquet', autoCorrectCorruptDates => false))" + " where date_col = date '1970-01-01'";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(1970, 1, 1, 0, 0))
    -            .go();
    -      }
    -    } finally {
    -      test("alter session reset all");
    -    }
    -  }
     
       @Test
       public void testReadPartitionedOnCorruptedDates_UserDisabledCorrection() throws Exception {
         try {
           for (String selection : new String[]{"*", "date_col"}) {
    -        // for sanity, try reading all partitions without a filter
    -        TestBuilder builder = testBuilder()
    -            .sqlQuery("select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "`" +
    -                "(type => 'parquet', autoCorrectCorruptDates => false))")
    -            .unOrdered()
    -            .baselineColumns("date_col");
    -        addCorruptedDateBaselineVals(builder);
    -        builder.go();
    -
    -        String query = "select " + selection + " from table(dfs.`" + CORRUPTED_PARTITIONED_DATES_1_2_PATH + "` " +
    -            "(type => 'parquet', autoCorrectCorruptDates => false))" + " where date_col = cast('15334-03-17' as date)";
    -        // verify that pruning is actually taking place
    -        testPlanMatchingPatterns(query, new String[]{"numFiles=1"}, null);
    -
    -        // read with a filter on the partition column
    -        testBuilder()
    -            .sqlQuery(query)
    -            .unOrdered()
    -            .baselineColumns("date_col")
    -            .baselineValues(new DateTime(15334, 03, 17, 0, 0))
    -            .go();
    +        for (String table : new String[]{CORRUPTED_PARTITIONED_DATES_1_2_PATH, CORRUPTED_PARTITIONED_DATES_1_4_0_PATH}) {
    --- End diff --
    
    Could you keep for block the same indent as original text?


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

[GitHub] drill pull request #687: DRILL-4996: Parquet Date auto-correction is not wor...

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

    https://github.com/apache/drill/pull/687


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