You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/10/11 23:13:55 UTC
[GitHub] [phoenix] gjacoby126 commented on a change in pull request #597: PHOENIX-5522 If index is disabled, IndexUpgradeTool should not fail d…
gjacoby126 commented on a change in pull request #597: PHOENIX-5522 If index is disabled, IndexUpgradeTool should not fail d…
URL: https://github.com/apache/phoenix/pull/597#discussion_r334201968
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
##########
@@ -491,6 +491,15 @@ private int rebuildIndexes(String dataTable, IndexTool indexingTool) {
try {
LOGGER.info("Rebuilding index: " + String.join(",", args));
if (!dryRun) {
+ // If the index is in DISABLED state, indexTool will fail. First to ALTER REBUILD ASYNC
+ String stmt = String.format("ALTER INDEX %s ON %s REBUILD ASYNC", indexName,
+ SchemaUtil.getTableName(schema, baseTable));
+ try {
+ conn.createStatement().execute(stmt);
+ } catch (SQLException ex) {
+ LOGGER.warning("Something went wrong while running ALTER REBUILD ASYNC the index "
Review comment:
nit: "ASYNC on the index "
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services