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

Alter table command can be used to set normalization_enabled=true on salted tables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.16.1, 5.1.2
    • 4.17.0, 5.2.0, 4.16.2, 5.1.3
    • None
    • None

    Description

      Here is what i found

      CREATE TABLE IF NOT EXISTS table1(a BIGINT NOT NULL, b BIGINT NOT NULL  CONSTRAINT PK PRIMARY KEY (a, b)) TTL=7776000, NORMALIZATION_ENABLED=true, SALT_BUCKETS=16, DISABLE_TABLE_SOR=true, NORMALIZER_TARGET_REGION_SIZE=5200;

      Error: ERROR 1147 (42Y86): Should not enable normalizer on salted table. tableName=TABLE1 (state=42Y86,code=1147)
      java.sql.SQLException: ERROR 1147 (42Y86): Should not enable normalizer on salted table. tableName=TABLE1
          at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:618)
          at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:228)
          at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1462)
          at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1983)
          at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:3094)
          at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1118)
          at org.apache.phoenix.compile.CreateTableCompiler$CreateTableMutationPlan.execute(CreateTableCompiler.java:421)
          at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:516)
          at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:482)
          at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
          at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:481)
          at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:469)
          at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2036)
          at sqlline.Commands.execute(Commands.java:814)
          at sqlline.Commands.sql(Commands.java:754)

       

       

      0: jdbc:phoenix:localhost:50141> CREATE TABLE IF NOT EXISTS table1(a BIGINT NOT NULL, b BIGINT NOT NULL  CONSTRAINT PK PRIMARY KEY (a, b)) TTL=7776000, NORMALIZATION_ENABLED=false, SALT_BUCKETS=16, DISABLE_TABLE_SOR=true, NORMALIZER_TARGET_REGION_SIZE=5200;
      No rows affected (2.295 seconds)

      0: jdbc:phoenix:localhost:50141> ALTER TABLE table1 set NORMALIZATION_ENABLED=true;
      No rows affected (1.374 seconds)

       So basically we are still able to set the normalization if we go through the alter table. 

      Attachments

        Issue Links

          Activity

            People

              stoty Istvan Toth
              mnpoonia Aman Poonia
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: