gjacoby126 commented on a change in pull request #648: Phoenix 5591 Fail
indextool if split-merge happens during job run
URL: https://github.com/apache/phoenix/pull/648#discussion_r354048288
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
##########
@@ -633,6 +635,83 @@ public void testSplitIndex() throws Exception {
}
}
+ /**
+ * Test that index tool fails when data table splits
+ */
+ @Test
+ public void testDataTableSplit() throws Exception {
+ if (localIndex) return; // can't split local indexes
+ if (!mutable) return;
+ if (transactional) return;
+ String schemaName = generateUniqueName();
+ String dataTableName = generateUniqueName();
+ String dataTableFullName = SchemaUtil.getTableName(schemaName,
dataTableName);
+ final TableName dataTN = TableName.valueOf(dataTableFullName);
+ String indexTableName = generateUniqueName();
+ String indexTableFullName = SchemaUtil.getTableName(schemaName,
indexTableName);
+ TableName indexTN = TableName.valueOf(indexTableFullName);
+ try (Connection conn =
+ DriverManager.getConnection(getUrl(),
PropertiesUtil.deepCopy(TEST_PROPERTIES));
+ Admin admin =
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) {
+ String dataDDL =
+ "CREATE TABLE " + dataTableFullName + "(\n"
+ + "ID VARCHAR NOT NULL PRIMARY KEY,\n"
+ + "\"info\".CAR_NUM VARCHAR(18) NULL,\n"
+ + "\"test\".CAR_NUM VARCHAR(18) NULL,\n"
+ + "\"info\".CAP_DATE VARCHAR NULL,\n" +
"\"info\".ORG_ID BIGINT NULL,\n"
+ + "\"info\".ORG_NAME VARCHAR(255) NULL\n" + ")
COLUMN_ENCODED_BYTES = 0";
+ conn.createStatement().execute(dataDDL);
Review comment:
You can create a table with a fixed set of splits using the SPLIT ON ()
clause of CREATE TABLE.
http://phoenix.apache.org/language/index.html#create_table Would simplify this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services