[ https://issues.apache.org/jira/browse/PHOENIX-7406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Palash Chauhan reassigned PHOENIX-7406: --------------------------------------- Assignee: Palash Chauhan > Index creation fails when creating a partial index on a table which was > created with column names in double quotes > ------------------------------------------------------------------------------------------------------------------ > > Key: PHOENIX-7406 > URL: https://issues.apache.org/jira/browse/PHOENIX-7406 > Project: Phoenix > Issue Type: Bug > Reporter: Palash Chauhan > Assignee: Palash Chauhan > Priority: Major > > {code:java} > CREATE TABLE TESTGLOBALINDEXWITHSORTKEY1 ("attr_0" VARCHAR NOT NULL, COL BSON > CONSTRAINT pk PRIMARY KEY ("attr_0")) {code} > {code:java} > CREATE INDEX G_IDX_TESTGLOBALINDEXWITHSORTKEY1 ON TESTGLOBALINDEXWITHSORTKEY1 > (BSON_VALUE(COL,'IdS','VARCHAR'),BSON_VALUE(COL,'Id2','DOUBLE')) INCLUDE > (COL) WHERE BSON_VALUE(COL,'IdS','VARCHAR') IS NOT NULL AND > BSON_VALUE(COL,'Id2','VARCHAR') IS NOT NULL > {code} > {code:java} > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): > Undefined column. columnName=TESTGLOBALINDEXWITHSORTKEY1.ATTR_0 > at > org.apache.phoenix.schema.PTableImpl.getColumnForColumnName(PTableImpl.java:1416) > at > org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.resolveColumn(FromCompiler.java:541) > at org.apache.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:511) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:1110) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:1096) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:612) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:593) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at > org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:592) > at > org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:580) > at > org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:181) > at > org.apache.phoenix.compile.CreateIndexCompiler.verifyIndexWhere(CreateIndexCompiler.java:196) > at > org.apache.phoenix.compile.CreateIndexCompiler.compile(CreateIndexCompiler.java:236) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateIndexStatement.compilePlan(PhoenixStatement.java:1504) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableCreateIndexStatement.compilePlan(PhoenixStatement.java:1486) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:612) > at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:593) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53) > at > org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:592) > at > org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:580) > at > org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:2406) > {code} > We should always use double quotes when forming the upsert query as part of > WHERE clause verification during partial index creation. -- This message was sent by Atlassian Jira (v8.20.10#820010)