Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Pig and Hive are both use <a href="http://www.antlr.org/" rel="nofollow">ANTLR</a> to build a compiler to parse their scripts. If you are not familar with the compiler theory, I suggest you read some related material.</p> <p>For Pig, the source codes for ANLTR are <code>src/org/apache/pig/parser/QueryLexer.g</code> and <code>src/org/apache/pig/parser/QueryParser.g</code>. They will be compiled to <code>org.apache.pig.parser.QueryLexer</code> and <code>org.apache.pig.parser.QueryParser</code>. However, these two classes are used to compile your Pig script to an abstract syntax tree. Then it will be transformed to <code>org.apache.pig.newplan.logical.relational.LogicalPlan</code>. After that, LogcialPlan will be transformed to <code>org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan</code>. Here I listed some related source files:</p> <pre><code>org.apache.pig.newplan.logical.relational.LogicalPlan org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans.MROperPlan org.apache.pig.parser.QueryParserDriver.parse(String) org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.compile(LogicalPlan, Properties) org.apache.pig.PigServer.launchPlan(PhysicalPlan, String) org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.compile(PhysicalPlan, PigContext) org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(MROperPlan, MapReduceOper, Configuration, PigContext) org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(MROperPlan, String) org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(PhysicalPlan, String, PigContext) org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrange.constructLROutput(List&lt;Result&gt;, List&lt;Result&gt;, Tuple) org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce.Map.collect(Context, Tuple) </code></pre> <p>For Hive, the source code for ANLTR is <code>ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g</code>. It will be compiled to <code>org.apache.hadoop.hive.ql.parse.HiveLexer</code> and <code>org.apache.hadoop.hive.ql.parse.HiveParser</code>. These two classes are used to compile your Hive script to an abstract syntax tree. Then it will be transformed to <code>org.apache.hadoop.hive.ql.QueryPlan</code>. The mapper and reducer in Hive are ExecMapper and ExecReducer. </p> <p>Here I listed some related source files:</p> <pre><code>org.apache.hadoop.hive.cli.CliDriver org.apache.hadoop.hive.ql.Driver org.apache.hadoop.hive.ql.Driver.run(String) org.apache.hadoop.hive.ql.parse.ParseDriver.parse(String, Context) org.apache.hadoop.hive.ql.parse.ParseDriver.parse(String, Context) org.apache.hadoop.hive.ql.parse.ASTNode org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer org.apache.hadoop.hive.ql.QueryPlan org.apache.hadoop.hive.ql.Driver.compile(String, boolean) org.apache.hadoop.hive.ql.exec.TaskRunner org.apache.hadoop.hive.ql.Driver.execute() org.apache.hadoop.hive.ql.exec.ExecDriver org.apache.hadoop.hive.ql.exec.ExecMapper org.apache.hadoop.hive.ql.exec.ExecReducer org.apache.hadoop.hive.ql.exec.MapOperator </code></pre> <p>At last, I suggest you download their source codes and browse them in the eclipse to find out any question you want to know by yourself.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload