Aman Poonia created PHOENIX-6616:
------------------------------------

             Summary: Alter table command can be used to set 
normalization_enabled=true on salted tables
                 Key: PHOENIX-6616
                 URL: https://issues.apache.org/jira/browse/PHOENIX-6616
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 5.1.2, 4.16.1
            Reporter: Aman Poonia


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. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to