abhishek-chouhan commented on a change in pull request #699: PHOENIX-5496
Ensure that we handle all server-side mutation codes on the client
URL: https://github.com/apache/phoenix/pull/699#discussion_r377981965
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##########
@@ -2957,149 +2958,180 @@ public boolean isViewReferenced() {
splits = SchemaUtil.processSplits(splits, pkColumns,
saltBucketNum, connection.getQueryServices().getProps().getBoolean(
QueryServices.FORCE_ROW_KEY_ORDER_ATTRIB,
QueryServicesOptions.DEFAULT_FORCE_ROW_KEY_ORDER));
}
- MetaDataMutationResult result =
connection.getQueryServices().createTable(
- tableMetaData,
- viewType == ViewType.MAPPED || allocateIndexId ?
physicalNames.get(0).getBytes() : null,
- tableType, tableProps, familyPropList, splits,
isNamespaceMapped, allocateIndexId,
- UpgradeUtil.isNoUpgradeSet(connection.getClientInfo()),
parent);
+
+ // Modularized this code for unit testing
+ MetaDataMutationResult result =
getCreateTableMutationResult(tableMetaData, viewType,
+ allocateIndexId, physicalNames, tableType, tableProps,
familyPropList, splits,
+ isNamespaceMapped, parent);
MutationCode code = result.getMutationCode();
- switch(code) {
+ if (code != MutationCode.TABLE_NOT_FOUND) {
+ boolean mutationResult =
handleCreateTableMutationCode(result, code, statement,
Review comment:
mutationResult doesn't look like the correct name from readability
perspective. Something like tableAreadyExists might be better. From a glance at
the function it looks like it returns true if thats the case.
----------------------------------------------------------------
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