For a pig script I am executing the following statement A = LOAD 'hbase://query/select * from TABLE_NAME where (DATE_1 >= to_date(\'2017-10-12 07:00:00\') and DATE < to_date(\'2017-10-14 07:00:00\')) OR (OTHER_DATE >= to_date(\'2017-10-12 07:00:00\') and OTHER_DATE < to_date(\'2017-10-14 07:00:00\'))' USING org.apache.phoenix.pig.PhoenixHBaseLoader('hbase_connection') AS (DATE_1:DATETIME, OTHER_DATE_2:DATETIME, DATE_3:DATETIME, ID:INT);
X = LIMIT A 5;
This throws a runtime exception : ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2135: Received error from store function.java.lang.RuntimeException: Unexpected data type org.apache.phoenix.shaded.org.joda.time.DateTime found stream. Note only standard Pig type is supported when you output from UDF/LoadFunc
This was an issue the JodaTime Class dependencies in the Pheonix-Pig and Pheonix-Client jars: https://issues.apache.org/jira/browse/PHOENIX-3240
The JodaTime class dependency needs to be removed/shaded from one of the Jars to prevent conflicts. Recommend working with HW support for a patch or upgrading to the latest version of Pheonix.