hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LUTTER, Steffen" <>
Subject Syntax for filters on timstamp data type
Date Fri, 05 Apr 2013 14:06:12 GMT

I have a question regarding filters on timestamps. The syntax seems to be UNIX_TIMESTAMP('yyyy-MM-dd
hh:mm:ss'), is there another way to express a datetime type? The problem is that I get an
exception when using the IN <list> syntax, while the equal comparison works without

Example: SELECT * FROM  table1 WHERE datecol IN ( UNIX_TIMESTAMP('2009-01-05 00:00:00'),UNIX_TIMESTAMP('2009-01-10
00:00:00')  )

Throws exception:

Caused by: java.sql.SQLException: Query returned non-zero code: 10014, cause: FAILED: SemanticException
[Error 10014]: Line 5:21 Wrong arguments ''2009-01-10 00:00:00'': The arguments for IN should
be the same type! Types are: {timestamp IN (bigint, bigint)}
       at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(
       at org.apache.hadoop.hive.jdbc.HiveStatement.execute(
       ... 15 more

Following query works:

SELECT * FROM  table1 WHERE datecol  =  UNIX_TIMESTAMP('2009-01-17 00:00:00')

Is there another syntax for datetime types? Could it be a bug in the filter "IN <list>"

Thanks in advance,


View raw message