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

NPE when ROW_TIMESTAMP is SQL timestamp column

    XMLWordPrintableJSON

Details

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

    Description

      See email discussion here: https://lists.apache.org/thread.html/d87a508e5b4e2fc6b7110d861b71209d2385adaecd0152b790ee00e9@%3Cuser.phoenix.apache.org%3E

      I'm not able to repro with this unit test:

          @Test
          public void testIndexHintOnTableWithRowTimestamp() throws Exception {
              Connection conn = DriverManager.getConnection(getUrl());
              try {
                  conn.createStatement().execute("CREATE IMMUTABLE TABLE t1 (k1 TIMESTAMP not null, k2 bigint not null, v bigint, constraint pk primary key (k1 row_timestamp,k2 ))");
                  conn.createStatement().execute("CREATE INDEX idx ON t1 (v)");
                  conn.createStatement().execute("SELECT /*+ INDEX(T1 IDX) */ K1,K2,V FROM t1 WHERE v = 5");
              } finally {
                  conn.close();
              }
          }
      

      FYI, due to the inability to keep an index in sync when there's a ROW_TIMESTAMP column, as of 4.12 we're disallowing the creation of mutable secondary indexes when a table has a ROW_TIMESTAMP column. Usually, since the timestamp is part of the row key, the data table can be declared IMMUTABLE. In this case, the index would still be allowed.

      Attachments

        1. PHOENIX-4265_v1.patch
          8 kB
          Samarth Jain
        2. PHOENIX-4265_v2.patch
          8 kB
          Samarth Jain

        Activity

          People

            samarthjain Samarth Jain
            jamestaylor James R. Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: