You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Lavrenty Eskin (JIRA)" <ji...@apache.org> on 2015/03/04 17:43:05 UTC

[jira] [Created] (PHOENIX-1698) Any_function(NULL as UNSIGNED_TIMESTAMP) raised ava.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 8 bytes, but had 0

Lavrenty Eskin created PHOENIX-1698:
---------------------------------------

             Summary: Any_function(NULL as UNSIGNED_TIMESTAMP) raised ava.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 8 bytes, but had 0
                 Key: PHOENIX-1698
                 URL: https://issues.apache.org/jira/browse/PHOENIX-1698
             Project: Phoenix
          Issue Type: Bug
         Environment: phoenix 4.3, hbase 0.98
            Reporter: Lavrenty Eskin
            Priority: Critical


NULL value in UNSIGNED_TIMESTAMP column raised "ERROR 201 (22000): Illegal data. Expected length of at least 8 bytes, but had 0" during any function implementation, f.e. TRUNC or TO_CHAR:

select ALARMRAISEDTIME from Alarms;
+---------------------+
|   ALARMRAISEDTIME   |
+---------------------+
| null                |
| 2001-02-03 06:05:06.0 |
| 2015-03-04 19:45:36.412 |
+---------------------+
3 rows selected (0.046 seconds)

select TRUNC(ALARMRAISEDTIME, 'HOUR') from Alarms;
+--------------------------------------------------------------------------+
| 
FLOOR(TO_UNSIGNED_DATE(TO_UNSIGNED_TIMESTAMP(ALARMRAISEDTIME))) |
+--------------------------------------------------------------------------+
java.lang.RuntimeException: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of at least 8 bytes, but had 0
        at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
        at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
        at sqlline.SqlLine.print(SqlLine.java:1809)
        at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
        at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
        at sqlline.SqlLine.dispatch(SqlLine.java:889)
        at sqlline.SqlLine.begin(SqlLine.java:763)
        at sqlline.SqlLine.start(SqlLine.java:498)
        at sqlline.SqlLine.main(SqlLine.java:460)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)