You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/02/10 19:39:11 UTC

[jira] [Commented] (PHOENIX-1588) TableNotFoundException when optimizing "SELECT * FROM a tenant-specific table"

    [ https://issues.apache.org/jira/browse/PHOENIX-1588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314619#comment-14314619 ] 

James Taylor commented on PHOENIX-1588:
---------------------------------------

[~maryannxue] - is this still an issue?

> TableNotFoundException when optimizing "SELECT * FROM a tenant-specific table"
> ------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1588
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1588
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Maryann Xue
>
> Testcase:
> {code}
>     public void testOptimizationTenantSpecific() throws Exception {
>         createBaseTable(TestUtil.DEFAULT_DATA_TABLE_NAME, null, "('e','i','o')", true);
>         Connection conn1 = DriverManager.getConnection(getUrl() + ';' + PhoenixRuntime.TENANT_ID_ATTRIB + "=tid1");
>         try{
>             conn1.createStatement().execute("UPSERT INTO " + TestUtil.DEFAULT_DATA_TABLE_NAME + " values(1,2,4,'z')");
>             conn1.createStatement().execute("UPSERT INTO " + TestUtil.DEFAULT_DATA_TABLE_NAME + " values(1,2,3,'a')");
>             conn1.createStatement().execute("UPSERT INTO " + TestUtil.DEFAULT_DATA_TABLE_NAME + " values(2,4,2,'a')");
>             conn1.createStatement().execute("UPSERT INTO " + TestUtil.DEFAULT_DATA_TABLE_NAME + " values(3,1,1,'c')");
>             conn1.commit();
>             createIndex(TestUtil.DEFAULT_INDEX_TABLE_NAME, TestUtil.DEFAULT_DATA_TABLE_NAME, "v1");
>             
>             String query = "SELECT * FROM " + TestUtil.DEFAULT_DATA_TABLE_NAME +" where v1='a'";
>             ResultSet rs = conn1.createStatement().executeQuery(query);
>             assertTrue(rs.next());
>             assertEquals(1, rs.getInt("k1"));
>             assertEquals(2, rs.getInt("k2"));
>             assertEquals(3, rs.getInt("k3"));
>             assertEquals("a", rs.getString("v1"));
>             assertTrue(rs.next());
>             assertEquals(2, rs.getInt("k1"));
>             assertEquals(4, rs.getInt("k2"));
>             assertEquals(2, rs.getInt("k3"));
>             assertEquals("a", rs.getString("v1"));
>             assertFalse(rs.next());
>         } finally {
>             conn1.close();
>         }
>     }
> {code}
> Stacktrace:
> org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=T
> 	at org.apache.phoenix.schema.PMetaDataImpl.getTable(PMetaDataImpl.java:241)
> 	at org.apache.phoenix.compile.ProjectionCompiler.projectAllIndexColumns(ProjectionCompiler.java:174)
> 	at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:330)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:490)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:447)
> 	at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:152)
> 	at org.apache.phoenix.optimize.QueryOptimizer.addPlan(QueryOptimizer.java:224)
> 	at org.apache.phoenix.optimize.QueryOptimizer.getApplicablePlans(QueryOptimizer.java:140)
> 	at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:81)
> 	at org.apache.phoenix.optimize.QueryOptimizer.optimize(QueryOptimizer.java:67)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:222)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:1)
> 	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:216)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:1030)
> 	...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)