jpisaac commented on PR #1701:
URL: https://github.com/apache/phoenix/pull/1701#issuecomment-1797011691

   ```
   CREATE TABLE IF NOT EXISTS S.T1(OID CHAR(15) NOT NULL,KP CHAR(3) NOT NULL, 
COL1 VARCHAR, CREATED_DATE DATE,CREATED_BY CHAR(15),LAST_UPDATE 
DATE,LAST_UPDATE_BY CHAR(15),SYSTEM_MODSTAMP DATE CONSTRAINT pk PRIMARY KEY 
(OID,KP)) MULTI_TENANT=true,COLUMN_ENCODED_BYTES=0;
   
   CREATE VIEW IF NOT EXISTS S.G1_001(ID1 INTEGER not null,ID2 VARCHAR not 
null,ID3 INTEGER not null, ROW_ID CHAR(15) not null, COL2 VARCHAR CONSTRAINT pk 
PRIMARY KEY (ID1, ID2, ID3, ROW_ID)) AS SELECT * FROM S.T1 WHERE KP = '001';
   
   CREATE INDEX IF NOT EXISTS PI1_COL2_INDEX ON S.G1_001 (COL2) INCLUDE(ROW_ID, 
SYSTEM_MODSTAMP) WHERE COL2 IS NOT NULL;
   ```
   
   Fails with the following exception -
   
   0: jdbc:phoenix:localhost> CREATE INDEX IF NOT EXISTS PI1_COL2_INDEX ON 
S.G1_001 (COL2) INCLUDE(ROW_ID, SYSTEM_MODSTAMP) WHERE COL2 IS NOT NULL;
   Error: ERROR 1046 (43A03): Column updated in VIEW may not differ from value 
specified in WHERE clause. value='a' columnName=KP (state=43A03,code=1046)
   java.sql.SQLException: ERROR 1046 (43A03): Column updated in VIEW may not 
differ from value specified in WHERE clause. value='a' columnName=KP
        at 
org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:655)
        at 
org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:229)
        at 
org.apache.phoenix.compile.UpsertCompiler$UpsertValuesMutationPlan.execute(UpsertCompiler.java:1275)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:559)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:525)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:524)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:512)
        at 
org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:181)
        at 
org.apache.phoenix.compile.CreateIndexCompiler.verifyIndexWhere(CreateIndexCompiler.java:158)
        at 
org.apache.phoenix.compile.CreateIndexCompiler.compile(CreateIndexCompiler.java:195)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateIndexStatement.compilePlan(PhoenixStatement.java:1384)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateIndexStatement.compilePlan(PhoenixStatement.java:1370)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:543)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:525)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:524)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:512)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2216)
        at sqlline.Commands.execute(Commands.java:814)
        at sqlline.Commands.sql(Commands.java:754)
        at sqlline.SqlLine.dispatch(SqlLine.java:646)
        at sqlline.SqlLine.begin(SqlLine.java:510)
        at sqlline.SqlLine.start(SqlLine.java:233)
        at sqlline.SqlLine.main(SqlLine.java:175)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to