Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22459

Hive datadiff function provided inconsistent results when hive.ferch.task.conversion is set to none

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • 3.0.0
    • None
    • HiveServer2
    • None

    Description

      Hive datadiff function provided inconsistent results when hive.ferch.task.conversion to more

      Below is output, whereas in Hive 1.2 the results are consistent

      Note: Same query works well on Hive 3 when hive.ferch.task.conversion is set to none
      Steps to reproduce the problem.

      0: jdbc:hive2://c1113-node2.squadron.support.> select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
      INFO : Compiling command(queryId=hive_20191105103636_1dff22a1-02f3-48a8-b076-0b91272f2268): select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183
      INFO : Semantic Analysis Completed (retrial = false)
      INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:datetimecol, type:string, comment:null)], properties:null)
      INFO : Completed compiling command(queryId=hive_20191105103636_1dff22a1-02f3-48a8-b076-0b91272f2268); Time taken: 0.479 seconds
      INFO : Executing command(queryId=hive_20191105103636_1dff22a1-02f3-48a8-b076-0b91272f2268): select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183
      INFO : Completed executing command(queryId=hive_20191105103636_1dff22a1-02f3-48a8-b076-0b91272f2268); Time taken: 0.013 seconds
      INFO : OK
      +--------------+
      | datetimecol |
      +--------------+
      | 2019-07-24 |
      +--------------+
      1 row selected (0.797 seconds)
      0: jdbc:hive2://c1113-node2.squadron.support.>
      

      After setting fetch task conversion as none.

      0: jdbc:hive2://c1113-node2.squadron.support.> set hive.fetch.task.conversion=none;
      No rows affected (0.017 seconds)
      0: jdbc:hive2://c1113-node2.squadron.support.> set hive.fetch.task.conversion;
      +----------------------------------+
      | set |
      +----------------------------------+
      | hive.fetch.task.conversion=none |
      +----------------------------------+
      1 row selected (0.015 seconds)
      0: jdbc:hive2://c1113-node2.squadron.support.> select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
      INFO : Compiling command(queryId=hive_20191105103709_0c38e446-09cf-45dd-9553-365146f42452): select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183
      
      
      +----------------------------+
      | datetimecol |
      +----------------------------+
      | 2019-09-09T10:45:49+02:00 |
      | 2019-07-24 |
      +----------------------------+
      2 rows selected (5.327 seconds)
      0: jdbc:hive2://c1113-node2.squadron.support.>
      

      Steps to reproduce

      create external table testdatediff(datetimecol string) stored as orc;
      insert into testdatediff values ('2019-09-09T10:45:49+02:00'),('2019-07-24');
      select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
      
      set hive.ferch.task.conversion=none;
      select datetimecol from testdatediff where datediff(cast(current_timestamp as string), datetimecol)<183;
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chiran54321 Chiran Ravani
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: