Skip to content

Commit 6330fac

Browse files
apurtellclaude
andcommitted
PHOENIX-7948 IndexTwoPhaseCreateIT requests an illegal transform
The test creates a mutable base table and then asserts that a transform to SINGLE_CELL_ARRAY_WITH_OFFSETS produces a new physical table with that storage scheme. SINGLE_CELL_ARRAY_WITH_OFFSETS is incompatible with in-place mutation, so Phoenix intentionally downgrades the requested scheme to ONE_CELL_PER_COLUMN for any mutable base table. Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
1 parent 132411c commit 6330fac

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexTwoPhaseCreateIT.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.Properties;
3636
import org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants;
3737
import org.apache.phoenix.end2end.IndexToolIT;
38+
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
3839
import org.apache.phoenix.end2end.transform.TransformToolIT;
3940
import org.apache.phoenix.jdbc.PhoenixConnection;
4041
import org.apache.phoenix.query.BaseTest;
@@ -50,9 +51,11 @@
5051
import org.junit.AfterClass;
5152
import org.junit.BeforeClass;
5253
import org.junit.Test;
54+
import org.junit.experimental.categories.Category;
5355

5456
import org.apache.phoenix.thirdparty.com.google.common.collect.Maps;
5557

58+
@Category(NeedsOwnMiniClusterTest.class)
5659
public class IndexTwoPhaseCreateIT extends BaseTest {
5760
@BeforeClass
5861
public static synchronized void doSetup() throws Exception {
@@ -131,9 +134,12 @@ public void testTransformingTableAndIndex() throws Exception {
131134
String tableName = "TBL_" + generateUniqueName();
132135
String idxName = "IND_" + generateUniqueName();
133136

137+
// The table must be immutable: SINGLE_CELL_ARRAY_WITH_OFFSETS packs all of a row's
138+
// columns into a single cell, which is incompatible with in-place mutation.
134139
String createTableSql =
135140
"CREATE TABLE " + tableName + " (PK1 VARCHAR NOT NULL, INT_PK INTEGER NOT NULL, "
136-
+ "V1 VARCHAR, V2 INTEGER CONSTRAINT NAME_PK PRIMARY KEY(PK1, INT_PK)) ";
141+
+ "V1 VARCHAR, V2 INTEGER CONSTRAINT NAME_PK PRIMARY KEY(PK1, INT_PK)) "
142+
+ "IMMUTABLE_ROWS=true";
137143
conn.createStatement().execute(createTableSql);
138144

139145
String upsertStmt =

0 commit comments

Comments
 (0)