You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2014/02/03 19:36:53 UTC

git commit: Disallow index on view until it's implemented

Updated Branches:
  refs/heads/master 3acaea4a5 -> 473ca2a7c


Disallow index on view until it's implemented


Project: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/commit/473ca2a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/473ca2a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/473ca2a7

Branch: refs/heads/master
Commit: 473ca2a7c552209b17e6f04141cebdef2d323823
Parents: 3acaea4
Author: James Taylor <ja...@apache.org>
Authored: Mon Feb 3 10:20:40 2014 -0800
Committer: James Taylor <ja...@apache.org>
Committed: Mon Feb 3 10:20:40 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/schema/MetaDataClient.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/473ca2a7/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
index f107350..695c67e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
@@ -59,6 +59,7 @@ import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
 import java.sql.Types;
 import java.util.Collection;
 import java.util.Collections;
@@ -487,6 +488,9 @@ public class MetaDataClient {
                 ColumnResolver resolver = FromCompiler.getResolver(statement, connection);
                 tableRef = resolver.getTables().get(0);
                 PTable dataTable = tableRef.getTable();
+                if (dataTable.getType() == PTableType.VIEW) {
+                    throw new SQLFeatureNotSupportedException("Creating an index on a view is not supported currently, but will be soon");
+                }
                 int hbaseVersion = connection.getQueryServices().getLowestClusterHBaseVersion();
                 if (!dataTable.isImmutableRows()) {
                     if (hbaseVersion < PhoenixDatabaseMetaData.MUTABLE_SI_VERSION_THRESHOLD) {