PHOENIX-2616 Indexes over immutable tables not marked as immutable
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/6251f8f8 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6251f8f8 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6251f8f8 Branch: refs/heads/calcite Commit: 6251f8f8c035ecf50051b974ca99499913e001c1 Parents: dab79cb Author: James Taylor <jtay...@salesforce.com> Authored: Wed Jan 20 21:40:00 2016 -0800 Committer: James Taylor <jtay...@salesforce.com> Committed: Wed Jan 20 21:40:00 2016 -0800 ---------------------------------------------------------------------- .../phoenix/query/ConnectionQueryServicesImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/6251f8f8/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index e8c5e1a..cf21452 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -187,12 +187,6 @@ import org.apache.twill.zookeeper.ZKClients; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import co.cask.tephra.TransactionSystemClient; -import co.cask.tephra.TxConstants; -import co.cask.tephra.distributed.PooledClientProvider; -import co.cask.tephra.distributed.TransactionServiceClient; -import co.cask.tephra.hbase11.coprocessor.TransactionProcessor; - import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Throwables; @@ -205,6 +199,12 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import co.cask.tephra.TransactionSystemClient; +import co.cask.tephra.TxConstants; +import co.cask.tephra.distributed.PooledClientProvider; +import co.cask.tephra.distributed.TransactionServiceClient; +import co.cask.tephra.hbase11.coprocessor.TransactionProcessor; + public class ConnectionQueryServicesImpl extends DelegateQueryServices implements ConnectionQueryServices { private static final Logger logger = LoggerFactory.getLogger(ConnectionQueryServicesImpl.class); @@ -2259,6 +2259,8 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement SQLException sqlE = null; try { metaConnection.createStatement().executeUpdate("ALTER TABLE " + tableName + " ADD " + (addIfNotExists ? " IF NOT EXISTS " : "") + columns ); + } catch (NewerTableAlreadyExistsException e) { + logger.warn("Table already modified at this timestamp, so assuming add of these columns already done: " + columns); } catch (SQLException e) { logger.warn("Add column failed due to:" + e); sqlE = e; @@ -2553,7 +2555,7 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement ")\n" + "WHERE A.COLUMN_FAMILY IS NULL AND\n" + " B.COLUMN_FAMILY IS NOT NULL AND\n" + - " A.IMMUTABLE_ROWS = TRUE;"); + " A.IMMUTABLE_ROWS = TRUE"); } finally { metaConnection.setAutoCommit(autoCommit); }