Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4079

Hive: Filter with a trailing space is not working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage - Hive
    • Labels:
      None

      Description

      The below query does not return the right result

      select * from hive.empty_lengthy_p2 where varchar_col='         ';
      +----------+--------------+
      | int_col  | varchar_col  |
      +----------+--------------+
      +----------+--------------+
      No rows selected (0.393 seconds)
      

      Data :

      1|dhfawriuueiq dshfjklhfiue eiufhwelfhleiruhj ejfwekjlf hsjdkgfhsdjk  hjd hdfkh sdhg dkj hsdhg jds gsdlgd sd hjk sdjhkjdhgsdhg
      2|jkdshgf jhg sdgj dlsg jsdgjg    jkdhgiergergd fgjgioug8945u irjfoiej0930j pofkqpgogogj dogj09g djvkldsjgjgirewoie dkflvsd vkdvskgjiwegjwe;sdkvjsdgfdgksdjgkdjkdjgksjg sdkjgdsjg skdjggj;sdgjd sk;gjsd
      3|dfg
      4|sdjklhkhjdfgjhdfgkjhdfkjldfsgjdsfkjhdfmnb,cv
      5|dfg
      6|
      7|jkdshgf jhg sdgj dlsg jsdgjg    jkdhgiergergd fgjgioug8945u irjfoiej0930j pofkqpgogogj dogj09g djvkldsjgjgirewoie dkflvsd vkdvskgjiwegjwe;sdkvjsdgfdgksdjgkdjkdjgksjg sdkjgdsjg skdjggj;sdgjd sk;gjsd
      8|?
      9|
      10|?
      

      Hive DDL :

      DROP TABLE IF EXISTS empty_lengthy;
      CREATE EXTERNAL TABLE empty_lengthy (
          int_col INT,
          varchar_col STRING
         )
      ROW FORMAT DELIMITED FIELDS TERMINATED BY "|"
      STORED AS TEXTFILE LOCATION "/drill/testdata/partition_pruning/hive/empty_lengthy_partitions.tbl";
      
      DROP TABLE IF EXISTS empty_lengthy_p2;
      CREATE TABLE empty_lengthy_p2 (
          int_col INT
         )
      PARTITIONED BY (varchar_col STRING)
      ROW FORMAT DELIMITED FIELDS TERMINATED BY "|"
      STORED AS TEXTFILE LOCATION "/drill/testdata/partition_pruning/hive/empty_lengthy_partitions_p2"
      TBLPROPERTIES ("serialization.null.format"="?");
      
      SET hive.exec.dynamic.partition.mode=true;
      
      insert overwrite table empty_lengthy_p2 partition (varchar_col)
      select int_col, varchar_col from empty_lengthy;
      

        Attachments

          Activity

            People

            • Assignee:
              volodymyr Vova Vysotskyi
              Reporter:
              rkins Rahul Kumar Challapalli
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: