You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by prasanthj <gi...@git.apache.org> on 2017/01/27 01:55:51 UTC

[GitHub] orc pull request #87: ORC-135: PPD for timestamp is wrong when reader and wr...

GitHub user prasanthj opened a pull request:

    https://github.com/apache/orc/pull/87

    ORC-135: PPD for timestamp is wrong when reader and writer timezones are different

    When reader and writer timezones are different, PPD evaluation does not offset the timezone when reading the min and max values. This can result is wrong PPD evaluation and hence incorrect results.
    
    Example:
    Table written in US/Eastern timezone. All values in this table are "2007-08-01 00:00:00.0".
    **PPD disabled**
    ```
    hive> set hive.optimize.index.filter=false;
    hive> select ORDER_DATE from ORDER_FACT_small where ORDER_DATE='2007-08-01 00:00:00.0' limit 1;
    2007-08-01 00:00:00.0
    OK
    ```
    
    **PPD enabled**
    ```
    set hive.optimize.index.filter=true;
    select ORDER_DATE from ORDER_FACT_small where ORDER_DATE='2007-08-01 00:00:00.0' limit 1;
    OK
    ```
    No rows are returned when PPD is enabled (reader timezone is UTC)

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

    $ git pull https://github.com/prasanthj/orc ORC-135

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

    https://github.com/apache/orc/pull/87.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 #87
    
----
commit 5adda854d749afd773e1fb4e8002eafd6561d4f6
Author: Prasanth Jayachandran <pr...@apache.org>
Date:   2017-01-27T01:48:25Z

    ORC-135: PPD for timestamp is wrong when reader and writer timezones are different

----


---
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] orc pull request #87: ORC-135: PPD for timestamp is wrong when reader and wr...

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

    https://github.com/apache/orc/pull/87#discussion_r98298881
  
    --- Diff: java/core/src/java/org/apache/orc/impl/ColumnStatisticsImpl.java ---
    @@ -19,6 +19,9 @@
     
     import java.sql.Date;
     import java.sql.Timestamp;
    +import java.util.Calendar;
    +import java.util.GregorianCalendar;
    +import java.util.TimeZone;
    --- End diff --
    
    These imports are not required. Will remove it in the next patch. 


---
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] orc issue #87: ORC-135: PPD for timestamp is wrong when reader and writer ti...

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

    https://github.com/apache/orc/pull/87
  
    Ok, I took a pass at this:
    
    https://github.com/omalley/orc/tree/orc-135
    
    Changes:
    * Block all use of PPD on timestamps from before ORC-135.
    * Block PPD on timestamp with numeric constraints
    * TimestampColumnStatistics.getMinimum and getMaximum return Timestamps in the local timezone.
    * Loading old TimestampColumnStatistics loads the min and max assuming local timezone.
    * Add utilities to SerializationUtils for conversion to and from utc.
    * Make BloomFilter.encoding an int so that we can detect future values.
    * Future BloomFilter encodings are not used.
    * Some more test cases
    



---
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] orc pull request #87: ORC-135: PPD for timestamp is wrong when reader and wr...

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

    https://github.com/apache/orc/pull/87


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