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

Incorrect TIMESTAMP result on JDBC direct read when next row has no (null) value for the TIMESTAMP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.13.0
    • 1.1.0
    • JDBC
    • None
    • Linux

    Description

      For the case:
      SELECT * FROM [table]

      JDBC direct reads the table backing data, versus cranking up a MR and creating a result set. This report is another direct read JDBC issue with TIMESTAMPS, see HIVE-8297 also.

      As in title, a succeeding row with no value corrupts the value read for the current row. To reproduce using beeline:

      1) Create this file as follows in HDFS.

      $ cat > /tmp/ts2.txt
      2014-09-28 00:00:00,2014-09-28 00:00:00,
      ,,
      <ctrl-D>
      $ hadoop fs -copyFromLocal /tmp/ts2.txt /tmp/ts2.txt

      2) In beeline load above HDFS data to a TEXTFILE table:
      $ beeline
      > !connect jdbc:hive2://<host>:<port>/<db> hive pass org.apache.hive.jdbc.HiveDriver
      > drop table `TIMESTAMP_TEXT2`;
      > CREATE TABLE `TIMESTAMP_TEXT2` (`ts1` TIMESTAMP, `ts2` TIMESTAMP) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\054' LINES TERMINATED BY '\012' STORED AS TEXTFILE;
      > LOAD DATA INPATH '/tmp/ts2.txt' OVERWRITE INTO TABLE
      `TIMESTAMP_TEXT2`;

      3) To demonstrate the corrupt data read, in beeline:
      > select * from `TIMESTAMP_TEXT2`;

      Note 1: The incorrect conduct demonstrated above replicates with a standalone Java/JDBC program.

      Note 2: Don't know if this is an issue with any other data types, also don't know what releases affected, however this occurs in Hive 13. Hive CLI works fine. Also works fine if you force a MR:
      select * from `TIMESTAMP_TEXT2` where 1=1;

      Attachments

        Activity

          People

            Unassigned Unassigned
            dougsedlak Doug Sedlak
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: