[
https://issues.jboss.org/browse/TEIID-3616?page=com.atlassian.jira.plugin...
]
Juraj Duráni commented on TEIID-3616:
-------------------------------------
[~rareddy] : Yes, I am using Phoenix driver (version in the Environment section) -
http://apache.miloslavbrada.cz/phoenix/phoenix-4.5.0-HBase-1.1/bin/
[~kylin] : I have added a "nameinsource" option to every column ([1]) but still
getting same NPE. I think that this is a PhoenixDriver's bug [2]. Returned value is
not checked, even "wasNull" property is not being set. I was able to reproduce
the bug using _ResultSet.getDate(int, Calendar)_ method [3]. My suggestion is to add a
temporal workaround (use _ResultSet.getDate(int)_ instead of _ResultSet.getDate(int,
Calendar)_), note to a documentation and wait for fix. It is maybe better if a user get a
date which can be shifted instead of NPE.
Just FYI. I will record a new bug for insert and update statements.
[1]
CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY OPTIONS (nameinsource
'intkey'),
StringKey string OPTIONS (nameinsource 'stringkey'),
IntNum integer OPTIONS (nameinsource 'intnum'),
StringNum string OPTIONS (nameinsource 'stringnum'),
FloatNum float OPTIONS (nameinsource 'floatnum'),
LongNum long OPTIONS (nameinsource 'longnum'),
DoubleNum double OPTIONS (nameinsource 'doublenum'),
ByteNum byte OPTIONS (nameinsource 'bytenum'),
DateValue date OPTIONS (nameinsource 'datevalue'),
TimeValue time OPTIONS (nameinsource 'timevalue'),
TimestampValue timestamp OPTIONS (nameinsource 'timestampvalue'),
BooleanValue boolean OPTIONS (nameinsource 'booleanvalue'),
CharValue char OPTIONS (nameinsource 'charvalue'),
ShortValue short OPTIONS (nameinsource 'shortvalue'),
BigIntegerValue biginteger OPTIONS (nameinsource
'bigintegervalue'),
BigDecimalValue bigdecimal OPTIONS (nameinsource
'bigdecimalvalue'),
ObjectValue object OPTIONS (nameinsource 'objectvalue')) OPTIONS
(CARDINALITY 50, UPDATABLE 'TRUE', nameinsource 'smalla');
[2]
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.phoenix/phoeni...
[3]
Exception in thread "main" java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1770)
at org.apache.phoenix.jdbc.PhoenixResultSet.getDate(PhoenixResultSet.java:388)
at sandbox.MainClass.phoenix(MainClass.java:80)
at sandbox.MainClass.main(MainClass.java:56)
HBase translator - NPE if date value is 'null'
----------------------------------------------
Key: TEIID-3616
URL:
https://issues.jboss.org/browse/TEIID-3616
Project: Teiid
Issue Type: Bug
Affects Versions: 8.7.1.6_2
Environment: Hbase: 1.1.1
Phoenix: 4.5.0-HBase-1.1
Reporter: Juraj Duráni
Assignee: Steven Hawkins
Attachments: log
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));
}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)