Repository: phoenix Updated Branches: refs/heads/3.0 7ebb87e7d -> 87fe59e5b
Phoenix-1275 SYSTEM.STATS table is not created when SYSTEM.CATALOG is already present Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/87fe59e5 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/87fe59e5 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/87fe59e5 Branch: refs/heads/3.0 Commit: 87fe59e5bca692397771e4fdfe298e90eff49384 Parents: 7ebb87e Author: Ramkrishna <ramkrishna.s.vasude...@intel.com> Authored: Thu Sep 25 16:21:00 2014 +0530 Committer: Ramkrishna <ramkrishna.s.vasude...@intel.com> Committed: Thu Sep 25 16:21:00 2014 +0530 ---------------------------------------------------------------------- .../phoenix/query/ConnectionQueryServicesImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/87fe59e5/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 0676e86..926407a 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 @@ -1295,9 +1295,6 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement ConnectionQueryServicesImpl.this, url, scnProps, newEmptyMetaData()); try { metaConnection.createStatement().executeUpdate(QueryConstants.CREATE_TABLE_METADATA); - // TODO : Get this from a configuration - metaConnection.createStatement().executeUpdate( - QueryConstants.CREATE_STATS_TABLE_METADATA); } catch (NewerTableAlreadyExistsException ignore) { // Ignore, as this will happen if the SYSTEM.CATALOG already exists at this fixed timestamp. // A TableAlreadyExistsException is not thrown, since the table only exists *after* this fixed timestamp. @@ -1326,6 +1323,14 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement metaConnection = addColumnsIfNotExists(metaConnection, PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME, MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP, newColumns); } + try { + metaConnection.createStatement().executeUpdate( + QueryConstants.CREATE_STATS_TABLE_METADATA); + } catch (NewerTableAlreadyExistsException ignore) { + + } catch (TableAlreadyExistsException ignore) { + + } } catch (Exception e) { if (e instanceof SQLException) { initializationException = (SQLException)e;