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

Modify RoundFloorCeilFuncIT, RowValueConstructorIT, SaltedTableIT, TenantIdTypeIT, StoreNullsIT and RebuildIndexConnectionPropsIT to not use CurrentSCN

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.12.0
    • Labels:
      None
    1. PHOENIX-4194_v2.patch
      91 kB
      Mujtaba Chohan
    2. PHOENIX-4194.patch
      86 kB
      Mujtaba Chohan

      Activity

      Hide
      jamestaylor James Taylor added a comment -

      Thanks, Mujtaba Chohan. Looks good, a couple of minor items that you can fix when you commit:

      • Looks like there are still a few references to nextTimestamp() here that need to be removed. You should be able to just pass in null instead:
        @@ -908,25 +848,27 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
             @Test
             public void testInListOfRVC1() throws Exception {
                 String tenantId = "ABC";
        +        String tableName = generateUniqueName();
        +        String viewName = generateUniqueName();
                 String tenantSpecificUrl = getUrl() + ";" + PhoenixRuntime.TENANT_ID_ATTRIB + '=' + tenantId;
        -        String baseTableDDL = "CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (tenantId,pk2,pk3)) MULTI_TENANT=true";
        +        String baseTableDDL = "CREATE TABLE " + tableName + " (tenantId varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (tenantId,pk2,pk3)) MULTI_TENANT=true";
                 createTestTable(getUrl(), baseTableDDL, null, nextTimestamp());
        -        String tenantTableDDL = "CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT *\n" + 
        -                "                FROM t";
        +        String tenantTableDDL = "CREATE VIEW " + viewName + " (tenant_col VARCHAR) AS SELECT *\n" + 
        +                "                FROM " + tableName;
                 createTestTable(tenantSpecificUrl, tenantTableDDL, null, nextTimestamp());
        
      • Just to confirm, are there perhaps calls to initEntityHistoryTableValues outside of the files you're changing so that's why you're adding/keeping this method?
        -    private static void initEntityHistoryTableValues(String tenantId, byte[][] splits, Date date, Long ts, String url) throws Exception {
        +    protected static String initEntityHistoryTableValues(String tenantId, byte[][] splits, Date date, String url) throws Exception {
        +        return initEntityHistoryTableValues(ENTITY_HISTORY_TABLE_NAME, tenantId, splits, date, null, url);
        +    }
        
      Show
      jamestaylor James Taylor added a comment - Thanks, Mujtaba Chohan . Looks good, a couple of minor items that you can fix when you commit: Looks like there are still a few references to nextTimestamp() here that need to be removed. You should be able to just pass in null instead: @@ -908,25 +848,27 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT { @Test public void testInListOfRVC1() throws Exception { String tenantId = "ABC" ; + String tableName = generateUniqueName(); + String viewName = generateUniqueName(); String tenantSpecificUrl = getUrl() + ";" + PhoenixRuntime.TENANT_ID_ATTRIB + '=' + tenantId; - String baseTableDDL = "CREATE TABLE t (tenantId varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (tenantId,pk2,pk3)) MULTI_TENANT= true " ; + String baseTableDDL = "CREATE TABLE " + tableName + " (tenantId varchar(5) NOT NULL, pk2 varchar(5) NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (tenantId,pk2,pk3)) MULTI_TENANT= true " ; createTestTable(getUrl(), baseTableDDL, null , nextTimestamp()); - String tenantTableDDL = "CREATE VIEW t_view (tenant_col VARCHAR) AS SELECT *\n" + - " FROM t" ; + String tenantTableDDL = "CREATE VIEW " + viewName + " (tenant_col VARCHAR) AS SELECT *\n" + + " FROM " + tableName; createTestTable(tenantSpecificUrl, tenantTableDDL, null , nextTimestamp()); Just to confirm, are there perhaps calls to initEntityHistoryTableValues outside of the files you're changing so that's why you're adding/keeping this method? - private static void initEntityHistoryTableValues( String tenantId, byte [][] splits, Date date, Long ts, String url) throws Exception { + protected static String initEntityHistoryTableValues( String tenantId, byte [][] splits, Date date, String url) throws Exception { + return initEntityHistoryTableValues(ENTITY_HISTORY_TABLE_NAME, tenantId, splits, date, null , url); + }
      Hide
      mujtabachohan Mujtaba Chohan added a comment -

      Thanks James Taylor

      • Removed places where I missed nextTimestamp()
      • initEntityHistoryTableValues(String tenantId, byte[][] splits, Date date, Long ts) is used by CursorWithRowValueConstructorIT but removed other unused methods for init*EntityHistory in BaseTest
      Show
      mujtabachohan Mujtaba Chohan added a comment - Thanks James Taylor Removed places where I missed nextTimestamp() initEntityHistoryTableValues(String tenantId, byte[][] splits, Date date, Long ts) is used by CursorWithRowValueConstructorIT but removed other unused methods for init*EntityHistory in BaseTest
      Hide
      jamestaylor James Taylor added a comment -

      +1

      Show
      jamestaylor James Taylor added a comment - +1
      Hide
      hudson Hudson added a comment -

      FAILURE: Integrated in Jenkins build Phoenix-master #1794 (See https://builds.apache.org/job/Phoenix-master/1794/)
      PHOENIX-4194 Modify RoundFloorCeilFuncIT, RowValueConstructorIT, (mujtaba: rev 1407a5ec84ff8ceb50e25efe6085d62df4544228)

      • (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
      • (edit) phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
      • (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableIT.java
      • (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFuncIT.java
      • (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
      • (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java
      Show
      hudson Hudson added a comment - FAILURE: Integrated in Jenkins build Phoenix-master #1794 (See https://builds.apache.org/job/Phoenix-master/1794/ ) PHOENIX-4194 Modify RoundFloorCeilFuncIT, RowValueConstructorIT, (mujtaba: rev 1407a5ec84ff8ceb50e25efe6085d62df4544228) (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java (edit) phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/salted/SaltedTableIT.java (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFuncIT.java (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/StoreNullsIT.java

        People

        • Assignee:
          mujtabachohan Mujtaba Chohan
          Reporter:
          mujtabachohan Mujtaba Chohan
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development