The default column name should not be necessary. Something is wrong with
the column resolution logic being using. Can you see this[1] JIRA and use
this same mechanism to do the column resolution?

Thanks,
James

[1] https://issues.apache.org/jira/browse/PHOENIX-898


On Thu, Apr 3, 2014 at 1:12 PM, Ravi Kiran <[email protected]>wrote:

>   Hi ,
>      Currently, while working on the Phoenix Pig support on
> v3.0.0.incubating branch , I notice that we need to pass the default column
> family with double quotes in the SELECT query.
>    A test case for it is
>
>
>     @Test
>     public void testSelectQueryWithDefaultCF() throws SQLException {
>         final Properties props = new Properties();
>         final Connection conn = DriverManager.getConnection(getUrl(),
> props);
>         conn.createStatement().execute("CREATE TABLE HIRES (id integer not
> null, name varchar, cf1.location varchar constraint pk primary key(id))");
>
>         final String query = "select id,0.name from HIRES";
>         final Statement statement = conn.createStatement();
>         statement.executeQuery(query);
>
>      }
>
>       The above test fails with the following error.
>     org.apache.phoenix.exception.PhoenixParserException: ERROR 601 (42P00):
> Syntax error. Encountered "." at line 1, column 12.
>     at
>
> org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33)
>     at
> org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111)
>     at
>
> org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:775)
>     at
>
> org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:856)
>     at
>
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:891)
>
>    However , the following queries work.
>       String query = "select id,\"0\".name from HIRES";
>       String query = "select id,name from HIRES";
>
> Is the exception an expected behaviour with default column family or a bug?
>
> Any help appreciated.
>
> Regards
> Ravi
>

Reply via email to