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

ASF GitHub Bot commented on PHOENIX-6518:
-----------------------------------------

richardantal commented on a change in pull request #1271:
URL: https://github.com/apache/phoenix/pull/1271#discussion_r678081138



##########
File path: phoenix-core/src/main/antlr3/PhoenixSQL.g
##########
@@ -496,6 +498,11 @@ show_node returns [ShowStatement ret]
     |   SHOW SCHEMAS (LIKE pattern=string_literal)? { $ret = 
factory.showSchemasStatement(pattern); }
     ;
 
+// Parse a describe statement. SHOW CREATE STATEMENT tablename ...
+show_create_statement_node returns [ShowCreateStatement ret]
+    :   SHOW CREATE STATEMENT tablename=from_table_name { $ret = 
factory.showCreateStatement(tablename); }

Review comment:
       This from_table_name can be actually a view or index table as well.
   
https://github.com/apache/phoenix/blob/9b76bd51c86faea117d963b8fc033dbfef647d47/phoenix-core/src/main/antlr3/PhoenixSQL.g#L1129
   
   It is already working for views and for indexes as well. I added some tests 
to be sure.
 Istvan was in the favour of naming this SHOW CREATE STATEMENT as 
it works for views and indexes as well.


   
   In case we chose to rename it to SHOW CREATE TABLE, should it work for views 
and indexes as well or Do you think those should be separate commands?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> Implement SHOW CREATE STATEMENT SQL command
> -------------------------------------------
>
>                 Key: PHOENIX-6518
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6518
>             Project: Phoenix
>          Issue Type: Task
>          Components: core
>            Reporter: Richárd Antal
>            Assignee: Richárd Antal
>            Priority: Major
>
> With PHOENIX-5946 and PHOENIX-6454 it is possible to generate effective DDL 
> for a table/view/index using the SchemaTool and an hbase command.
> Implement SHOW CREATE STATEMENT sql command to further utilize this 
> functionality.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to