You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "tamtam180 (Created) (JIRA)" <ji...@apache.org> on 2012/02/12 12:50:59 UTC

[jira] [Created] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

utc_from_timestamp and utc_to_timestamp returns incorrect results.
------------------------------------------------------------------

                 Key: HIVE-2803
                 URL: https://issues.apache.org/jira/browse/HIVE-2803
             Project: Hive
          Issue Type: Bug
          Components: UDF
    Affects Versions: 0.8.0
            Reporter: tamtam180


How to reproduce:

{noformat}
$ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
hive> create table ts1(t1 timestamp);
hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
{noformat}

The following result is expected:
{noformat}
 2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
{noformat}
However, the above query return incorrect result like this:
{noformat}
 2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
{noformat}

This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
On evaluating query, timestamp argument always returns the same instance.
GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
That means it adds all offsets in the query.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260073#comment-13260073 ] 

Carl Steinbach commented on HIVE-2803:
--------------------------------------

@tamtam180: can you please upload another copy of the patch and click the box that grants license rights to the ASF? Thanks!
                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>             Fix For: 0.10.0
>
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Carl Steinbach (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214221#comment-13214221 ] 

Carl Steinbach commented on HIVE-2803:
--------------------------------------

@tamtam180: If this patch is ready for review can you please change the status to 'Patch Available' and submit a review request using Phabricator? Instructions are located here:
https://cwiki.apache.org/confluence/display/Hive/HowToContribute#HowToContribute-ReviewProcess

Thanks!
                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>         Attachments: HIVE-2803.1.patch.txt
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Phabricator (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phabricator updated HIVE-2803:
------------------------------

    Attachment: HIVE-2803.D1959.1.patch

tamtam180 requested code review of "HIVE-2803 [jira] utc_from_timestamp and utc_to_timestamp returns incorrect results.".
Reviewers: JIRA

  https://issues.apache.org/jira/browse/HIVE-2803

  HIVE-2803 utc_from_timestamp and utc_to_timestamp returns incorrect results.

  It changed so that applyOffset() return a new instance.

  How to reproduce:


  $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
  hive> create table ts1(t1 timestamp);
  hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
  hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;



  The following result is expected:

   2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456


  However, the above query return incorrect result like this:

   2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456



  This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
  On evaluating query, timestamp argument always returns the same instance.
  GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
  That means it adds all offsets in the query.

TEST PLAN
  EMPTY

REVISION DETAIL
  https://reviews.facebook.net/D1959

AFFECTED FILES
  ql/src/test/results/clientpositive/timestamp_udf.q.out
  ql/src/test/queries/clientpositive/timestamp_udf.q
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java

MANAGE HERALD DIFFERENTIAL RULES
  https://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  https://reviews.facebook.net/herald/transcript/4143/

Tip: use the X-Herald-Rules header to filter Herald messages in your client.

                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "tamtam180 (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216361#comment-13216361 ] 

tamtam180 commented on HIVE-2803:
---------------------------------

Carl,
thanks your advice.
I tried use of Phabricator, and changed status to 'Patch Available'.

                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-2803:
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.10.0
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

Committed to trunk. Thanks Tamtam180!
                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>             Fix For: 0.10.0
>
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "tamtam180 (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

tamtam180 updated HIVE-2803:
----------------------------

    Attachment: HIVE-2803.1.patch.txt

Attached is the patch which fixes this issue.
It changed so that applyOffset() return a new instance.


                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>         Attachments: HIVE-2803.1.patch.txt
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Phabricator (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260076#comment-13260076 ] 

Phabricator commented on HIVE-2803:
-----------------------------------

tamtam180 has committed the revision "HIVE-2803 [jira] utc_from_timestamp and utc_to_timestamp returns incorrect results.".

  Change committed by cws.

REVISION DETAIL
  https://reviews.facebook.net/D1959

COMMIT
  https://reviews.facebook.net/rHIVE1329507

                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>             Fix For: 0.10.0
>
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Sho Shimauchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sho Shimauchi reassigned HIVE-2803:
-----------------------------------

    Assignee: tamtam180
    
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "tamtam180 (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

tamtam180 updated HIVE-2803:
----------------------------

    Attachment: HIVE-2803.D1959.1.patch

Final version which grants rights to the ASF.

                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>             Fix For: 0.10.0
>
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "tamtam180 (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

tamtam180 updated HIVE-2803:
----------------------------

    Status: Patch Available  (was: Open)
    
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>         Attachments: HIVE-2803.1.patch.txt
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2803) utc_from_timestamp and utc_to_timestamp returns incorrect results.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260299#comment-13260299 ] 

Hudson commented on HIVE-2803:
------------------------------

Integrated in Hive-trunk-h0.21 #1392 (See [https://builds.apache.org/job/Hive-trunk-h0.21/1392/])
    HIVE-2803 [jira] utc_from_timestamp and utc_to_timestamp returns incorrect
results.
(Kiyotaka Suzuki via Carl Steinbach)

Summary:
https://issues.apache.org/jira/browse/HIVE-2803

HIVE-2803 utc_from_timestamp and utc_to_timestamp returns incorrect results.

It changed so that applyOffset() return a new instance.

How to reproduce:


$ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
hive> create table ts1(t1 timestamp);
hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST')
from ts1 limit 1;



The following result is expected:

 2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25
18:00:00.123456


However, the above query return incorrect result like this:

 2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26
03:00:00.492456



This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime()
improperly.
On evaluating query, timestamp argument always returns the same instance.
GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
That means it adds all offsets in the query.

Test Plan: EMPTY

Reviewers: JIRA

Differential Revision: https://reviews.facebook.net/D1959 (Revision 1329507)

     Result = FAILURE
cws : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1329507
Files : 
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java
* /hive/trunk/ql/src/test/queries/clientpositive/timestamp_udf.q
* /hive/trunk/ql/src/test/results/clientpositive/timestamp_udf.q.out

                
> utc_from_timestamp and utc_to_timestamp returns incorrect results.
> ------------------------------------------------------------------
>
>                 Key: HIVE-2803
>                 URL: https://issues.apache.org/jira/browse/HIVE-2803
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0
>            Reporter: tamtam180
>            Assignee: tamtam180
>             Fix For: 0.10.0
>
>         Attachments: HIVE-2803.1.patch.txt, HIVE-2803.D1959.1.patch, HIVE-2803.D1959.1.patch
>
>
> How to reproduce:
> {noformat}
> $ echo "2011-12-25 09:00:00.123456" > /tmp/data5.txt
> hive> create table ts1(t1 timestamp);
> hive> load data local inpath '/tmp/data5.txt' overwrite into table ts1;
> hive> select t1, from_utc_timestamp(t1, 'JST'), from_utc_timestamp(t1, 'JST') from ts1 limit 1;
> {noformat}
> The following result is expected:
> {noformat}
>  2011-12-25 09:00:00.123456      2011-12-25 18:00:00.123456      2011-12-25 18:00:00.123456
> {noformat}
> However, the above query return incorrect result like this:
> {noformat}
>  2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456      2011-12-26 03:00:00.492456
> {noformat}
> This is because GenericUDFFromUtcTimestamp.applyOffset() does setTime() improperly.
> On evaluating query, timestamp argument always returns the same instance.
> GenericUDFFromUtcTimestamp.applyOffset() does setTime() on the instance.
> That means it adds all offsets in the query.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira