Hi guys

     As I know create table a like b syntax should have been supported since long before(refer to https://issues.apache.org/jira/browse/PHOENIX-734)

 ,however when i am using phoenix 4.5, i got below exception:

0: jdbc:phoenix:cnzk0,cnzk1,cnzk2> create table debug_visit like visit;

Error: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting "LPAREN", got "like" at line 1, column 26. (state=42P00,code=604)

org.apache.phoenix.exception.PhoenixParserException: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting "LPAREN", got "like" at line 1, column 26.

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:1224)

at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1305)

at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1368)

at sqlline.Commands.execute(Commands.java:822)

at sqlline.Commands.sql(Commands.java:732)

at sqlline.SqlLine.dispatch(SqlLine.java:808)

at sqlline.SqlLine.begin(SqlLine.java:681)

at sqlline.SqlLine.start(SqlLine.java:398)

at sqlline.SqlLine.main(SqlLine.java:292)

Caused by: MismatchedTokenException(86!=90)

at org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatchedToken(PhoenixSQLParser.java:349)

at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)

at org.apache.phoenix.parse.PhoenixSQLParser.create_table_node(PhoenixSQLParser.java:1032)

at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:782)

at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:497)

at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)

... 9 more


     So I checked the grammar page and found  no "like" semantic there. Is there a quick way to do the same thing? 

     Thank you.



--------------------------------
 
Thanks&Best regards!
San.Luo