[ 
https://issues.apache.org/jira/browse/HIVE-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784473#action_12784473
 ] 

Ning Zhang commented on HIVE-924:
---------------------------------

Yes, I can use that revision # to apply your patch.

The CTAS was originally added to DDLSemanticAnalyzer but due to some 
difficulties, we move it to SemanticAnalyzer. The main reason is that the we 
need to analyze the select part first to get the schema of the target table and 
the operator tree, and use that schema to change the last moveTask and the 
metastore call to create the table. If we do it separately, the 
DDLSemanticAnalyzer need to recursively call SemanticAnalyzer and workthrough 
the intermediate result (operator tree) from the output of the SemanticAnalyzer 
to change the move task and add the DDLTask, and then call the rest of 
SemanticAnalyzer to generate mapredWork. That makes it more complex and error 
prone. I think with your refactoring SemanticAlayzer into LogicalPlan and 
PhysicalPlan, it will make it easier for separating CTAS to 
DDLSemanticAnalyzer.  

> Extract LogicalPlan and PhysicalPlan classes from SemanticAnalysis class
> ------------------------------------------------------------------------
>
>                 Key: HIVE-924
>                 URL: https://issues.apache.org/jira/browse/HIVE-924
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Query Processor
>            Reporter: Carl Steinbach
>         Attachments: HIVE-924.patch
>
>
> Currently the SemanticAnalyzer class handles semantic analysis, as well as 
> logical plan generation and physical plan generation. I think it would be 
> beneficial to extract distinct LogicalPlan and PhysicalPlan classes from the 
> SemanticAnalyzer, and have the query processing phase be coordinated by a 
> QueryCompiler class that would be responsible for triggering the parsing, 
> semantic analysis, logical plan generation, optimization, and physical plan 
> generation phases. This proposed reorganization of components would help to 
> isolate the state of each phase, and would also bring the source into closer 
> alignment with the description of the query compiler in the Hive design 
> document on the wiki.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to