Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3616

HBase translator - NPE if date value is 'null'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.7.1.6_2, 8.12
    • 8.7.1.6_2
    • None
    • None
    • Hide

      HBase table:
      create table smalla(intkey integer primary key,stringkey varchar(10),intnum integer,stringnum varchar(10),floatnum float,longnum bigint,doublenum float,bytenum tinyint,datevalue date,timevalue time,timestampvalue timestamp,booleanvalue boolean,charvalue char(1),shortvalue smallint,bigintegervalue decimal(20,0),bigdecimalvalue decimal(25,5),objectvalue varchar(500));

      VDB table:
      CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY,
      StringKey string,
      IntNum integer,
      StringNum string,
      FloatNum float,
      LongNum long,
      DoubleNum double,
      ByteNum byte,
      DateValue date,
      TimeValue time,
      TimestampValue timestamp,
      BooleanValue boolean,
      CharValue char,
      ShortValue short,
      BigIntegerValue biginteger,
      BigDecimalValue bigdecimal,
      ObjectValue object) OPTIONS (CARDINALITY 50, UPDATABLE 'TRUE');

      Show
      HBase table: create table smalla(intkey integer primary key,stringkey varchar(10),intnum integer,stringnum varchar(10),floatnum float,longnum bigint,doublenum float,bytenum tinyint,datevalue date,timevalue time,timestampvalue timestamp,booleanvalue boolean,charvalue char(1),shortvalue smallint,bigintegervalue decimal(20,0),bigdecimalvalue decimal(25,5),objectvalue varchar(500)); VDB table: CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY, StringKey string, IntNum integer, StringNum string, FloatNum float, LongNum long, DoubleNum double, ByteNum byte, DateValue date, TimeValue time, TimestampValue timestamp, BooleanValue boolean, CharValue char, ShortValue short, BigIntegerValue biginteger, BigDecimalValue bigdecimal, ObjectValue object) OPTIONS (CARDINALITY 50, UPDATABLE 'TRUE');

      If the source table in HBase contains a 'NULL' date value, Teiid throws an NPE. I did not encounter any NPE using org.apache.phoenix.jdbc.PhoenixDriver [1]. Other data types seem to be OK too.
      I have tried integer, char, varchar, float, double, tinyint, smallint, bigint, decimal, varbinary, boolean, time, date, timestamp.

      [1]
      Connection con = new org.apache.phoenix.jdbc.PhoenixDriver().connect("jdbc:phoenix:localhost", new Properties())
      ResultSet rs = con.createStatement().executeQuery("select datevalue from smalla");
      while(rs.next()){
      System.out.println(rs.getDate(1));
      }

        1. log
          6 kB
          Juraj Duráni

              rhn-engineering-shawkins Steven Hawkins
              jdurani Juraj Duráni (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: