Type mismatch. VARCHAR and TIMESTAMP with Pheonix

3.3k views Asked by At

Getting Error:

ERROR 203 (22005): Type mismatch. VARCHAR and TIMESTAMP for '2017-08-30 06:21:46.732'
SQLState:  22005
ErrorCode: 203

while executing the below query in SQuirrel SQL Client with apache.pheonix

select * from USER_T where USR_CRT=cast('2017-08-30 06:21:46.732' AS timestamp)

and USR_CRT type is TIMESTAMP

1

There are 1 answers

0
Diego On

Wich version of Phoenix are you using?

With the function TO_TIMESTAMP works like a charm for me. Your query will be:

select * from USER_T where USR_CRT = TO_TIMESTAMP('2017-08-30 06:21:46.732')

I'm using Phoenix 4.11.0 with HBase 1.3.1 and Hadoop 2.7.3 over AWS EMR