Sergey Soldatov created PHOENIX-4645:
----------------------------------------

             Summary: PhoenixStorageHandler doesn't handle correctly 
data/timestamp in push down predicate when engine is tez. 
                 Key: PHOENIX-4645
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4645
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.14.0
            Reporter: Sergey Soldatov
            Assignee: Sergey Soldatov
             Fix For: 4.14.0


DDLs:
{noformat}
CREATE TABLE TEST_PHOENIX
(
PART_ID BIGINT NOT NULL,
COMMIT_TIMESTAMP TIMESTAMP,
CONSTRAINT pk PRIMARY KEY (PART_ID)
)
SALT_BUCKETS=9;
CREATE EXTERNAL TABLE TEST_HIVE
(
PART_ID BIGINT,
SOURCEDB_COMMIT_TIMESTAMP TIMESTAMP
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
TBLPROPERTIES
(
"phoenix.table.name" = "TEST_PHOENIX",
"phoenix.zookeeper.quorum" = "localhost",
"phoenix.zookeeper.znode.parent" = "/hbase",
"phoenix.zookeeper.client.port" = "2181",
"phoenix.rowkeys" = "PART_ID",
"phoenix.column.mapping" = 
"part_id:PART_ID,sourcedb_commit_timestamp:COMMIT_TIMESTAMP"
);

{noformat}
Query :
{noformat}
hive> select * from TEST_HIVE2 where sourcedb_commit_timestamp between 
'2018-03-01 01:00:00.000' and  '2018-03-20 01:00:00.000';
OK
Failed with exception java.io.IOException:java.lang.RuntimeException: 
org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type 
mismatch. TIMESTAMP and VARCHAR for "sourcedb_commit_timestamp" >= '2018-03-01 
01:00:00.000'
{noformat}

That happens because we don't use mapped column name when we check whether we 
need to apply to_timestamp/to_date function. For the default mapping, we regexp 
patterns don't take into account that column name is double quoted. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to