Bug 1252005

Summary: HBase translator - NPE if date value is 'null'
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Juraj Duráni <jdurani>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact: Juraj Duráni <jdurani>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: atangrin, vhalbert
Target Milestone: CR1Keywords: QA-Closed
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Hbase: 1.1.1 Phoenix: 4.5.0-HBase-1.1
Last Closed: 2016-02-10 08:54:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Server log none

Description Juraj Duráni 2015-08-10 13:28:41 UTC
Created attachment 1061069 [details]
Server log

Describe the issue: 
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)); } 


Steps to reproduce:


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');