Fang-Yu Rao has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22623


Change subject: IMPALA-13653: Create hooks for Calcite planner in Frontend
......................................................................

IMPALA-13653: Create hooks for Calcite planner in Frontend

This commit creates hooks into the Impala planner that will
call into the Calcite planner.

There is one factory hook and 3 compilation hooks introduced to
allow this to happen:

- CompilerFactory :  This factory hook has methods to create the
implementations for the three interfaces described below. The idea is
to introduce a query option that allows the Calcite objects to be called
instead of the Impala planner. In this iteration, the only
implementation called is the Impala specific implementations.

- ParsedStatement: The implementation of this interface will parse
the SQL query into an AST in its constructor. The implementation will
be a wrapper for the AST which can be accessed through the "getTopLevelNode"
method. For the current planner, the "StatementBase" object will be
accessible via this method.

- AnalysisDriver: The implementation of this interface will analyze the
parsed AST via the "analyze" method. To make the code review as easy
as possible, the AnalyzeDriverImpl implementation has been placed inside
the AnalysisContext object.

- SingleNodePlannerIntf: The implementation of this interface will
return a PlanNode that can run on a single node via the
"createSingleNodePlan" method. Various other methods in this
interface allow access to data structures that are needed for the final
plan. These objects are related to the output Expr objects.

There is an additional "getFallbackFactory" method included in the
CompilerFactory interface. This method is meant to allow the CompilerFactory
to supply a "fallback" compiler to use if it cannot handle the sql
statement passed in. For the Impala implementation, there is no fallback
and will return null.

Change-Id: I70385e2d77c2cd6801a8e6e362e0020b32516e97
---
M fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
A fe/src/main/java/org/apache/impala/analysis/ParsedStatement.java
A fe/src/main/java/org/apache/impala/analysis/ParsedStatementImpl.java
M fe/src/main/java/org/apache/impala/analysis/StmtMetadataLoader.java
A fe/src/main/java/org/apache/impala/common/FallbackException.java
M fe/src/main/java/org/apache/impala/planner/Planner.java
M fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
A fe/src/main/java/org/apache/impala/planner/SingleNodePlannerIntf.java
A fe/src/main/java/org/apache/impala/service/CompilerFactory.java
A fe/src/main/java/org/apache/impala/service/CompilerFactoryImpl.java
M fe/src/main/java/org/apache/impala/service/Frontend.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriteRulesTest.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/analysis/StmtMetadataLoaderTest.java
M fe/src/test/java/org/apache/impala/common/FrontendFixture.java
M fe/src/test/java/org/apache/impala/common/FrontendTestBase.java
M fe/src/test/java/org/apache/impala/common/QueryFixture.java
18 files changed, 575 insertions(+), 126 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/23/22623/1
--
To view, visit http://gerrit.cloudera.org:8080/22623
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70385e2d77c2cd6801a8e6e362e0020b32516e97
Gerrit-Change-Number: 22623
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao <fangyu....@cloudera.com>
Gerrit-Reviewer: Steve Carlin <scar...@cloudera.com>

Reply via email to