Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4645

PhoenixStorageHandler doesn't handle correctly data/timestamp in push down predicate when engine is tez.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.14.0
    • 4.14.0
    • None

    Description

      DDLs:

      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"
      );
      
      

      Query :

      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'
      

      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.

      Attachments

        1. PHOENIX-4645-wip.patch
          3 kB
          Sergey Soldatov
        2. PHOENIX-4645.patch
          6 kB
          Sergey Soldatov

        Activity

          People

            sergey.soldatov Sergey Soldatov
            sergey.soldatov Sergey Soldatov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: