twdsilva commented on a change in pull request #455: PHOENIX-4900 Modify
MAX_MUTATION_SIZE_EXCEEDED and MAX_MUTATION_SIZE_…
URL: https://github.com/apache/phoenix/pull/455#discussion_r263519500
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
##########
@@ -59,7 +59,54 @@ private void upsertRows(PhoenixConnection conn, String
fullTableName) throws SQL
}
@Test
- public void testMaxMutationSize() throws Exception {
+ public void testDeleteMaxMutationSize() throws SQLException {
+ String tableName = generateUniqueName();
+ int NUMBER_OF_ROWS = 20;
+ String ddl = "CREATE TABLE " + tableName + " (V BIGINT PRIMARY KEY, K
BIGINT)";
+ PhoenixConnection conn = (PhoenixConnection)
DriverManager.getConnection(getUrl());
+ conn.createStatement().execute(ddl);
+
+ for(int i = 0; i < NUMBER_OF_ROWS; i++) {
+ conn.createStatement().execute(
+ "UPSERT INTO " + tableName + " VALUES (" + i + ", "+ i +
")");
+ conn.commit();
+ }
+
+ Properties props = new Properties();
+ props.setProperty(QueryServices.MAX_MUTATION_SIZE_ATTRIB,
+ String.valueOf(NUMBER_OF_ROWS / 2));
+ PhoenixConnection connection =
+ (PhoenixConnection) DriverManager.getConnection(getUrl(),
props);
+ connection.setAutoCommit(false);
+
+ try {
+ for(int i = 0; i < NUMBER_OF_ROWS; i++) {
+ connection.createStatement().execute(
+ "DELETE FROM " + tableName + " WHERE K = " + i );
+ }
+ } catch (SQLException e) {
+ assertTrue(e.getMessage().contains(
+ SQLExceptionCode.MAX_MUTATION_SIZE_EXCEEDED.getMessage()));
+ }
+
+ props = new Properties();
Review comment:
remove this block as it duplicated
----------------------------------------------------------------
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