drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [41/45] drill git commit: DRILL-3987: (MOVE) Move logical expressions and operators out of common. Move to new drill-logical model.
Date Fri, 13 Nov 2015 02:38:11 GMT
DRILL-3987: (MOVE) Move logical expressions and operators out of common. Move to new drill-logical model.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/44dea433
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/44dea433
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/44dea433

Branch: refs/heads/master
Commit: 44dea433395f00126021e72eb581e0f07e481d0a
Parents: a289fd9
Author: Jacques Nadeau <jacques@apache.org>
Authored: Sun Nov 8 09:35:45 2015 -0800
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Thu Nov 12 17:00:49 2015 -0800

----------------------------------------------------------------------
 .../drill/common/expression/parser/ExprLexer.g  | 154 -----
 .../drill/common/expression/parser/ExprParser.g | 323 ---------
 .../org/apache/drill/common/JSONOptions.java    | 184 -----
 .../apache/drill/common/SerializedExecutor.java | 144 ----
 .../common/config/LogicalPlanPersistence.java   |  65 --
 .../exceptions/ExecutionSetupException.java     |  56 --
 .../exceptions/ExpressionParsingException.java  |  45 --
 .../LogicalOperatorValidationException.java     |  44 --
 .../exceptions/LogicalPlanParsingException.java |  48 --
 .../common/expression/BooleanOperator.java      |  66 --
 .../drill/common/expression/CastExpression.java |  67 --
 .../common/expression/ConvertExpression.java    |  85 ---
 .../drill/common/expression/ErrorCollector.java |  45 --
 .../common/expression/ErrorCollectorImpl.java   | 115 ----
 .../common/expression/ExpressionFunction.java   |  96 ---
 .../common/expression/ExpressionPosition.java   |  50 --
 .../expression/ExpressionStringBuilder.java     | 332 ----------
 .../drill/common/expression/FieldReference.java | 133 ----
 .../drill/common/expression/FunctionCall.java   |  81 ---
 .../common/expression/FunctionCallFactory.java  | 132 ----
 .../expression/FunctionHolderExpression.java    |  83 ---
 .../drill/common/expression/FunctionName.java   |  29 -
 .../drill/common/expression/IfExpression.java   | 163 -----
 .../common/expression/LogicalExpression.java    | 110 ---
 .../expression/LogicalExpressionBase.java       |  81 ---
 .../drill/common/expression/NullExpression.java |  60 --
 .../common/expression/OutputTypeDeterminer.java |  97 ---
 .../drill/common/expression/PathSegment.java    | 309 ---------
 .../drill/common/expression/SchemaPath.java     | 290 --------
 .../common/expression/TypedNullConstant.java    |  54 --
 .../common/expression/ValidationError.java      |  22 -
 .../common/expression/ValueExpressions.java     | 664 -------------------
 .../common/expression/fn/CastFunctions.java     | 151 -----
 .../drill/common/expression/fn/FuncHolder.java  |  23 -
 .../common/expression/fn/package-info.java      |  21 -
 .../drill/common/expression/package-info.java   |  29 -
 .../drill/common/expression/types/AtomType.java |  68 --
 .../drill/common/expression/types/DataType.java | 147 ----
 .../expression/types/DataTypeFactory.java       |  25 -
 .../common/expression/types/LateBindType.java   |  53 --
 .../common/expression/types/package-info.java   |  21 -
 .../visitors/AbstractExprVisitor.java           | 176 -----
 .../expression/visitors/AggregateChecker.java   | 206 ------
 .../visitors/ConditionalExprOptimizer.java      | 112 ----
 .../expression/visitors/ConstantChecker.java    | 210 ------
 .../common/expression/visitors/ExprVisitor.java |  72 --
 .../visitors/ExpressionValidationError.java     |  31 -
 .../visitors/ExpressionValidationException.java |  38 --
 .../visitors/ExpressionValidator.java           | 234 -------
 .../common/expression/visitors/OpVisitor.java   |  24 -
 .../expression/visitors/SimpleExprVisitor.java  | 158 -----
 .../expression/visitors/package-info.java       |  24 -
 .../drill/common/graph/AdjacencyList.java       | 190 ------
 .../common/graph/AdjacencyListBuilder.java      |  75 ---
 .../org/apache/drill/common/graph/Edge.java     |  42 --
 .../org/apache/drill/common/graph/Graph.java    |  68 --
 .../apache/drill/common/graph/GraphAlgos.java   | 159 -----
 .../apache/drill/common/graph/GraphValue.java   |  26 -
 .../apache/drill/common/graph/GraphVisitor.java |  25 -
 .../apache/drill/common/graph/Visitable.java    |  22 -
 .../apache/drill/common/graph/package-info.java |  21 -
 .../common/logical/FormatPluginConfig.java      |  40 --
 .../common/logical/FormatPluginConfigBase.java  |  44 --
 .../drill/common/logical/LogicalPlan.java       | 122 ----
 .../common/logical/LogicalPlanBuilder.java      |  56 --
 .../drill/common/logical/PlanProperties.java    | 121 ----
 .../common/logical/StoragePluginConfig.java     |  43 --
 .../common/logical/StoragePluginConfigBase.java |  37 --
 .../common/logical/UnexpectedOperatorType.java  |  35 -
 .../drill/common/logical/ValidationError.java   |  43 --
 .../common/logical/data/AbstractBuilder.java    |  46 --
 .../logical/data/AbstractSingleBuilder.java     |  42 --
 .../drill/common/logical/data/Filter.java       |  53 --
 .../drill/common/logical/data/Flatten.java      |  67 --
 .../common/logical/data/GroupingAggregate.java  | 101 ---
 .../apache/drill/common/logical/data/Join.java  | 140 ----
 .../common/logical/data/JoinCondition.java      |  55 --
 .../apache/drill/common/logical/data/Limit.java |  79 ---
 .../common/logical/data/LogicalOperator.java    |  56 --
 .../logical/data/LogicalOperatorBase.java       |  92 ---
 .../common/logical/data/NamedExpression.java    |  52 --
 .../apache/drill/common/logical/data/Order.java | 252 -------
 .../drill/common/logical/data/Project.java      |  92 ---
 .../common/logical/data/RunningAggregate.java   |  63 --
 .../apache/drill/common/logical/data/Scan.java  |  78 ---
 .../drill/common/logical/data/Sequence.java     | 187 ------
 .../logical/data/SingleInputOperator.java       |  53 --
 .../drill/common/logical/data/SinkOperator.java |  30 -
 .../common/logical/data/SourceOperator.java     |  35 -
 .../apache/drill/common/logical/data/Store.java |  85 ---
 .../drill/common/logical/data/Transform.java    |  54 --
 .../apache/drill/common/logical/data/Union.java |  94 ---
 .../drill/common/logical/data/Values.java       |  69 --
 .../drill/common/logical/data/Window.java       | 120 ----
 .../drill/common/logical/data/Writer.java       |  61 --
 .../drill/common/logical/data/package-info.java |  21 -
 .../data/visitors/AbstractLogicalVisitor.java   | 126 ----
 .../logical/data/visitors/LogicalVisitor.java   |  66 --
 .../logical/data/visitors/package-info.java     |  21 -
 .../drill/common/logical/package-info.java      |  25 -
 .../drill/common/util/AbstractDynamicBean.java  |  81 ---
 .../java/org/apache/drill/common/util/Hook.java |  79 ---
 .../common/expression/PathSegmentTests.java     |  46 --
 .../common/expression/parser/TreeTest.java      | 118 ----
 .../drill/common/logical/data/OrderTest.java    |  93 ---
 .../drill/storage/CheckStorageConfig.java       |  51 --
 exec/java-exec/pom.xml                          |   5 +
 .../apache/drill/common/SerializedExecutor.java | 144 ++++
 exec/vector/pom.xml                             |  24 +-
 logical/pom.xml                                 | 163 +++++
 .../drill/common/expression/parser/ExprLexer.g  | 154 +++++
 .../drill/common/expression/parser/ExprParser.g | 323 +++++++++
 .../org/apache/drill/common/JSONOptions.java    | 184 +++++
 .../common/config/LogicalPlanPersistence.java   |  65 ++
 .../exceptions/ExecutionSetupException.java     |  56 ++
 .../exceptions/ExpressionParsingException.java  |  45 ++
 .../LogicalOperatorValidationException.java     |  44 ++
 .../exceptions/LogicalPlanParsingException.java |  48 ++
 .../common/expression/BooleanOperator.java      |  66 ++
 .../drill/common/expression/CastExpression.java |  67 ++
 .../common/expression/ConvertExpression.java    |  85 +++
 .../drill/common/expression/ErrorCollector.java |  45 ++
 .../common/expression/ErrorCollectorImpl.java   | 115 ++++
 .../common/expression/ExpressionFunction.java   |  96 +++
 .../common/expression/ExpressionPosition.java   |  50 ++
 .../expression/ExpressionStringBuilder.java     | 332 ++++++++++
 .../drill/common/expression/FieldReference.java | 133 ++++
 .../drill/common/expression/FunctionCall.java   |  81 +++
 .../common/expression/FunctionCallFactory.java  | 132 ++++
 .../expression/FunctionHolderExpression.java    |  83 +++
 .../drill/common/expression/FunctionName.java   |  29 +
 .../drill/common/expression/IfExpression.java   | 163 +++++
 .../common/expression/LogicalExpression.java    | 110 +++
 .../expression/LogicalExpressionBase.java       |  81 +++
 .../drill/common/expression/NullExpression.java |  60 ++
 .../common/expression/OutputTypeDeterminer.java |  97 +++
 .../drill/common/expression/PathSegment.java    | 309 +++++++++
 .../drill/common/expression/SchemaPath.java     | 290 ++++++++
 .../common/expression/TypedNullConstant.java    |  54 ++
 .../common/expression/ValidationError.java      |  22 +
 .../common/expression/ValueExpressions.java     | 664 +++++++++++++++++++
 .../common/expression/fn/CastFunctions.java     | 151 +++++
 .../drill/common/expression/fn/FuncHolder.java  |  23 +
 .../common/expression/fn/package-info.java      |  21 +
 .../drill/common/expression/package-info.java   |  29 +
 .../drill/common/expression/types/AtomType.java |  68 ++
 .../drill/common/expression/types/DataType.java | 147 ++++
 .../expression/types/DataTypeFactory.java       |  25 +
 .../common/expression/types/LateBindType.java   |  53 ++
 .../common/expression/types/package-info.java   |  21 +
 .../visitors/AbstractExprVisitor.java           | 176 +++++
 .../expression/visitors/AggregateChecker.java   | 206 ++++++
 .../visitors/ConditionalExprOptimizer.java      | 112 ++++
 .../expression/visitors/ConstantChecker.java    | 210 ++++++
 .../common/expression/visitors/ExprVisitor.java |  72 ++
 .../visitors/ExpressionValidationError.java     |  31 +
 .../visitors/ExpressionValidationException.java |  38 ++
 .../visitors/ExpressionValidator.java           | 234 +++++++
 .../common/expression/visitors/OpVisitor.java   |  24 +
 .../expression/visitors/SimpleExprVisitor.java  | 158 +++++
 .../expression/visitors/package-info.java       |  24 +
 .../drill/common/graph/AdjacencyList.java       | 190 ++++++
 .../common/graph/AdjacencyListBuilder.java      |  75 +++
 .../org/apache/drill/common/graph/Edge.java     |  42 ++
 .../org/apache/drill/common/graph/Graph.java    |  68 ++
 .../apache/drill/common/graph/GraphAlgos.java   | 159 +++++
 .../apache/drill/common/graph/GraphValue.java   |  26 +
 .../apache/drill/common/graph/GraphVisitor.java |  25 +
 .../apache/drill/common/graph/Visitable.java    |  22 +
 .../apache/drill/common/graph/package-info.java |  21 +
 .../common/logical/FormatPluginConfig.java      |  40 ++
 .../common/logical/FormatPluginConfigBase.java  |  44 ++
 .../drill/common/logical/LogicalPlan.java       | 122 ++++
 .../common/logical/LogicalPlanBuilder.java      |  56 ++
 .../drill/common/logical/PlanProperties.java    | 121 ++++
 .../common/logical/StoragePluginConfig.java     |  43 ++
 .../common/logical/StoragePluginConfigBase.java |  37 ++
 .../common/logical/UnexpectedOperatorType.java  |  35 +
 .../drill/common/logical/ValidationError.java   |  43 ++
 .../common/logical/data/AbstractBuilder.java    |  46 ++
 .../logical/data/AbstractSingleBuilder.java     |  42 ++
 .../drill/common/logical/data/Filter.java       |  53 ++
 .../drill/common/logical/data/Flatten.java      |  67 ++
 .../common/logical/data/GroupingAggregate.java  | 101 +++
 .../apache/drill/common/logical/data/Join.java  | 140 ++++
 .../common/logical/data/JoinCondition.java      |  55 ++
 .../apache/drill/common/logical/data/Limit.java |  79 +++
 .../common/logical/data/LogicalOperator.java    |  56 ++
 .../logical/data/LogicalOperatorBase.java       |  92 +++
 .../common/logical/data/NamedExpression.java    |  52 ++
 .../apache/drill/common/logical/data/Order.java | 252 +++++++
 .../drill/common/logical/data/Project.java      |  92 +++
 .../common/logical/data/RunningAggregate.java   |  63 ++
 .../apache/drill/common/logical/data/Scan.java  |  78 +++
 .../drill/common/logical/data/Sequence.java     | 187 ++++++
 .../logical/data/SingleInputOperator.java       |  53 ++
 .../drill/common/logical/data/SinkOperator.java |  30 +
 .../common/logical/data/SourceOperator.java     |  35 +
 .../apache/drill/common/logical/data/Store.java |  85 +++
 .../drill/common/logical/data/Transform.java    |  54 ++
 .../apache/drill/common/logical/data/Union.java |  94 +++
 .../drill/common/logical/data/Values.java       |  69 ++
 .../drill/common/logical/data/Window.java       | 120 ++++
 .../drill/common/logical/data/Writer.java       |  61 ++
 .../drill/common/logical/data/package-info.java |  21 +
 .../data/visitors/AbstractLogicalVisitor.java   | 126 ++++
 .../logical/data/visitors/LogicalVisitor.java   |  66 ++
 .../logical/data/visitors/package-info.java     |  21 +
 .../drill/common/logical/package-info.java      |  25 +
 .../drill/common/util/AbstractDynamicBean.java  |  81 +++
 .../common/expression/PathSegmentTests.java     |  46 ++
 .../common/expression/parser/TreeTest.java      | 118 ++++
 .../drill/common/logical/data/OrderTest.java    |  93 +++
 .../drill/storage/CheckStorageConfig.java       |  51 ++
 214 files changed, 10109 insertions(+), 10008 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
----------------------------------------------------------------------
diff --git a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g b/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
deleted file mode 100644
index a881b5c..0000000
--- a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprLexer.g
+++ /dev/null
@@ -1,154 +0,0 @@
-lexer grammar ExprLexer;
-
-options {
-    language=Java;
-}
-
-@header {
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.drill.common.expression.parser;
-}
-
-If       : 'if';
-Else     : 'else';
-Return   : 'return';
-Then     : 'then';
-End      : 'end';
-In       : 'in';
-Case     : 'case';
-When     : 'when';
-
-Cast: 'cast';
-Convert  : 'convert_' ('from' | 'to');
-Nullable: 'nullable';
-Repeat: 'repeat';
-As: 'as';
-
-BIT      : 'bit' | 'BIT';
-INT      : 'int' | 'INT';
-BIGINT   : 'bigint' | 'BIGINT';
-FLOAT4   : 'float4' | 'FLOAT4';
-FLOAT8   : 'float8' | 'FLOAT8';
-VARCHAR  : 'varchar' | 'VARCHAR';
-VARBINARY: 'varbinary' | 'VARBINARY';
-DATE     : 'date' | 'DATE';
-TIMESTAMP: 'timestamp' | 'TIMESTAMP';
-TIME     : 'time' | 'TIME';
-TIMESTAMPTZ: 'timestamptz' | 'TIMESTAMPTZ';
-INTERVAL : 'interval' | 'INTERVAL';
-INTERVALYEAR : 'intervalyear' | 'INTERVALYEAR';
-INTERVALDAY : 'intervalday' | 'INTERVALDAY';
-Period : '.';
-DECIMAL9 : 'decimal9' | 'DECIMAL9';
-DECIMAL18 : 'decimal18' | 'DECIMAL18';
-DECIMAL28DENSE : 'decimal28dense' | 'DECIMAL28DENSE';
-DECIMAL28SPARSE : 'decimal28sparse' | 'DECIMAL28SPARSE';
-DECIMAL38DENSE : 'decimal38dense' | 'DECIMAL38DENSE';
-DECIMAL38SPARSE : 'decimal38sparse' | 'DECIMAL38SPARSE';
-Or       : 'or' | 'OR' | 'Or';
-And      : 'and' | 'AND' ;
-Equals   : '==' | '=';
-NEquals  : '<>' | '!=';
-GTEquals : '>=';
-LTEquals : '<=';
-Caret      : '^';
-Excl     : '!';
-GT       : '>';
-LT       : '<';
-Plus      : '+';
-Minus : '-';
-Asterisk : '*';
-ForwardSlash   : '/';
-Percent  : '%';
-OBrace   : '{';
-CBrace   : '}';
-OBracket : '[';
-CBracket : ']';
-OParen   : '(';
-CParen   : ')';
-SColon   : ';';
-Comma    : ',';
-QMark    : '?';
-Colon    : ':';
-SingleQuote: '\'';
-
-Bool
-  :  'true' 
-  |  'false'
-  ;
-
-Number
-  :  Int ('.' Digit*)? (('e' | 'E') ('+' | '-')? Digit*)?
-  ;
-
-//Float
-//  :  Int ('.' Digit*)? ('e' ('+' | '-')? Digit*)?
-//  ;
-//
-//Integer
-//  :  Digit Digit*
-//  ;
-  
-Identifier
-  : ('a'..'z' | 'A'..'Z' | '_' | '$') ('a'..'z' | 'A'..'Z' | '_' | '$' | Digit)*
-  ;
-
-QuotedIdentifier
-@after {
-  setText(getText().substring(1, getText().length()-1).replaceAll("\\\\(.)", "$1"));
-}
-  :  '`'  (~('`' | '\\')  | '\\' ('\\' | '`'))* '`' 
-  ;
-
-String
-@after {
-  setText(getText().substring(1, getText().length()-1).replaceAll("\\\\(.)", "$1"));
-}
-  :  '\'' (~('\'' | '\\') | '\\' ('\\' | '\''))* '\''
-  ;
-
-Comment
-  :  '//' ~('\r' | '\n')* {skip();}
-  |  '/*' .* '*/'         {skip();}
-  ;
-
-Space
-  :  (' ' | '\t' | '\r' | '\n' | '\u000C') {skip();}
-  ;
-
-fragment Int
-  :  '1'..'9' Digit*
-  |  '0'
-  ;
-  
-fragment Digit 
-  :  '0'..'9'
-  ;
-
-FallThrough
-	@after{
-	  throw new RuntimeException(java.lang.String.format(
-	      "Encountered an illegal char on line \%d, column \%d: '\%s'", 
-	      getLine(), getCharPositionInLine(), getText()
-	    )
-	  );
-	}
-  :
-  ;

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprParser.g
----------------------------------------------------------------------
diff --git a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprParser.g b/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprParser.g
deleted file mode 100644
index 600b791..0000000
--- a/common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprParser.g
+++ /dev/null
@@ -1,323 +0,0 @@
-parser grammar ExprParser;
-
-options{
-  output=AST;
-  language=Java;
-  tokenVocab=ExprLexer;
-  backtrack=true;
-  memoize=true;
-}
-
-
-
-@header {
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.drill.common.expression.parser;
-  
-//Explicit import...
-import org.antlr.runtime.BitSet;
-import java.util.*;
-import org.apache.drill.common.expression.*;
-import org.apache.drill.common.expression.PathSegment.NameSegment;
-import org.apache.drill.common.expression.PathSegment.ArraySegment;
-import org.apache.drill.common.types.*;
-import org.apache.drill.common.types.TypeProtos.*;
-import org.apache.drill.common.types.TypeProtos.DataMode;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.common.exceptions.ExpressionParsingException;
-}
-
-@members{
-  private String fullExpression;
-  private int tokenPos;
-
-  public static void p(String s){
-    System.out.println(s);
-  }
-  
-  public ExpressionPosition pos(Token token){
-    return new ExpressionPosition(fullExpression, token.getTokenIndex());
-  }
-  
-  @Override    
-  public void displayRecognitionError(String[] tokenNames, RecognitionException e) {
-	String hdr = getErrorHeader(e);
-    String msg = getErrorMessage(e, tokenNames);
-    throw new ExpressionParsingException("Expression has syntax error! " + hdr + ":" + msg);
-  }
-}
-
-parse returns [LogicalExpression e]
-  :  expression EOF {
-    $e = $expression.e; 
-    if(fullExpression == null) fullExpression = $expression.text;
-    tokenPos = $expression.start.getTokenIndex();
-  }
-  ;
- 
-functionCall returns [LogicalExpression e]
-  :  Identifier OParen exprList? CParen {$e = FunctionCallFactory.createExpression($Identifier.text, pos($Identifier), $exprList.listE);  }
-  ;
-
-convertCall returns [LogicalExpression e]
-  :  Convert OParen expression Comma String CParen
-      { $e = FunctionCallFactory.createConvert($Convert.text, $String.text, $expression.e, pos($Convert));}
-  ;
-
-castCall returns [LogicalExpression e]
-	@init{
-  	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  ExpressionPosition p = null;
-	}  
-  :  Cast OParen expression As dataType repeat? CParen 
-      {  if ($repeat.isRep!=null && $repeat.isRep.compareTo(Boolean.TRUE)==0)
-           $e = FunctionCallFactory.createCast(TypeProtos.MajorType.newBuilder().mergeFrom($dataType.type).setMode(DataMode.REPEATED).build(), pos($Cast), $expression.e);
-         else
-           $e = FunctionCallFactory.createCast($dataType.type, pos($Cast), $expression.e);}
-  ;
-
-repeat returns [Boolean isRep]
-  : Repeat { $isRep = Boolean.TRUE;}
-  ;
-
-dataType returns [MajorType type]
-	: numType  {$type =$numType.type;}
-	| charType {$type =$charType.type;}
-	| dateType {$type =$dateType.type;}
-	| booleanType {$type =$booleanType.type;}
-	;
-
-booleanType returns [MajorType type]
-	: BIT { $type = Types.required(TypeProtos.MinorType.BIT); }
-	;
-
-numType returns [MajorType type]
-	: INT    { $type = Types.required(TypeProtos.MinorType.INT); }
-	| BIGINT { $type = Types.required(TypeProtos.MinorType.BIGINT); }
-	| FLOAT4 { $type = Types.required(TypeProtos.MinorType.FLOAT4); }
-	| FLOAT8 { $type = Types.required(TypeProtos.MinorType.FLOAT8); }
-	| DECIMAL9 OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL9).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	| DECIMAL18 OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL18).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	| DECIMAL28DENSE OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL28DENSE).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	| DECIMAL28SPARSE OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL28SPARSE).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	| DECIMAL38DENSE OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL38DENSE).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	| DECIMAL38SPARSE OParen precision Comma scale CParen { $type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.DECIMAL38SPARSE).setMode(DataMode.REQUIRED).setPrecision($precision.value.intValue()).setScale($scale.value.intValue()).build(); }
-	;
-
-charType returns [MajorType type]
-	:  VARCHAR typeLen {$type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.VARCHAR).setMode(DataMode.REQUIRED).setWidth($typeLen.length.intValue()).build(); }
-	|  VARBINARY typeLen {$type = TypeProtos.MajorType.newBuilder().setMinorType(TypeProtos.MinorType.VARBINARY).setMode(DataMode.REQUIRED).setWidth($typeLen.length.intValue()).build();}	
-	;
-
-precision returns [Integer value]
-    : Number {$value = Integer.parseInt($Number.text); }
-    ;
-
-scale returns [Integer value]
-    : Number {$value = Integer.parseInt($Number.text); }
-    ;
-
-dateType returns [MajorType type]
-    : DATE { $type = Types.required(TypeProtos.MinorType.DATE); }
-    | TIMESTAMP   { $type = Types.required(TypeProtos.MinorType.TIMESTAMP); }
-    | TIME   { $type = Types.required(TypeProtos.MinorType.TIME); }
-    | TIMESTAMPTZ   { $type = Types.required(TypeProtos.MinorType.TIMESTAMPTZ); }
-    | INTERVAL { $type = Types.required(TypeProtos.MinorType.INTERVAL); }
-    | INTERVALYEAR { $type = Types.required(TypeProtos.MinorType.INTERVALYEAR); }
-    | INTERVALDAY { $type = Types.required(TypeProtos.MinorType.INTERVALDAY); }
-    ;
-
-typeLen returns [Integer length]
-    : OParen Number CParen {$length = Integer.parseInt($Number.text);}
-    ;
-
-ifStatement returns [LogicalExpression e]
-	@init {
-	  IfExpression.Builder s = IfExpression.newBuilder();
-	}
-	@after {
-	  $e = s.build();
-	}  
-  :  i1=ifStat {s.setIfCondition($i1.i); s.setPosition(pos($i1.start)); } (elseIfStat { s.setIfCondition($elseIfStat.i); } )* Else expression { s.setElse($expression.e); }End
-  ;
-
-ifStat returns [IfExpression.IfCondition i]
-  : If e1=expression Then e2=expression { $i = new IfExpression.IfCondition($e1.e, $e2.e); }
-  ;
-elseIfStat returns [IfExpression.IfCondition i]
-  : Else If e1=expression Then e2=expression { $i = new IfExpression.IfCondition($e1.e, $e2.e); }
-  ;
-
-caseStatement returns [LogicalExpression e]
-	@init {
-	  IfExpression.Builder s = IfExpression.newBuilder();
-	}
-	@after {
-	  $e = s.build();
-	}  
-  : Case (caseWhenStat {s.setIfCondition($caseWhenStat.e); }) + caseElseStat { s.setElse($caseElseStat.e); } End
-  ;
-  
-caseWhenStat returns [IfExpression.IfCondition e]
-  : When e1=expression Then e2=expression {$e = new IfExpression.IfCondition($e1.e, $e2.e); }
-  ;
-  
-caseElseStat returns [LogicalExpression e]
-  : Else expression {$e = $expression.e; }
-  ;
-  
-exprList returns [List<LogicalExpression> listE]
-	@init{
-	  $listE = new ArrayList<LogicalExpression>();
-	}
-  :  e1=expression {$listE.add($e1.e); } (Comma e2=expression {$listE.add($e2.e); } )*
-  ;
-
-expression returns [LogicalExpression e]  
-  :  ifStatement {$e = $ifStatement.e; }
-  |  caseStatement {$e = $caseStatement.e; }
-  |  condExpr {$e = $condExpr.e; }
-  ;
-
-condExpr returns [LogicalExpression e]
-  :  orExpr {$e = $orExpr.e; }
-  ;
-
-orExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  if(exprs.size() == 1){
-	    $e = exprs.get(0);
-	  }else{
-	    $e = FunctionCallFactory.createBooleanOperator("or", p, exprs);
-	  }
-	}
-  :  a1=andExpr { exprs.add($a1.e); p = pos( $a1.start );} (Or a2=andExpr { exprs.add($a2.e); })*
-  ;
-
-andExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  if(exprs.size() == 1){
-	    $e = exprs.get(0);
-	  }else{
-	    $e = FunctionCallFactory.createBooleanOperator("and", p, exprs);
-	  }
-	}
-  :  e1=equExpr { exprs.add($e1.e); p = pos( $e1.start );  } ( And e2=equExpr { exprs.add($e2.e);  })*
-  ;
-
-equExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  List<String> cmps = new ArrayList();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  $e = FunctionCallFactory.createByOp(exprs, p, cmps);
-	}
-  :  r1=relExpr { exprs.add($r1.e); p = pos( $r1.start );
-    } ( cmpr= ( Equals | NEquals ) r2=relExpr {exprs.add($r2.e); cmps.add($cmpr.text); })*
-  ;
-
-relExpr returns [LogicalExpression e]
-  :  left=addExpr {$e = $left.e; } (cmpr = (GTEquals | LTEquals | GT | LT) right=addExpr {$e = FunctionCallFactory.createExpression($cmpr.text, pos($left.start), $left.e, $right.e); } )?
-  ;
-
-addExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  List<String> ops = new ArrayList();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  $e = FunctionCallFactory.createByOp(exprs, p, ops);
-	}
-  :  m1=mulExpr  {exprs.add($m1.e); p = pos($m1.start); } ( op=(Plus|Minus) m2=mulExpr {exprs.add($m2.e); ops.add($op.text); })* 
-  ;
-
-mulExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  List<String> ops = new ArrayList();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  $e = FunctionCallFactory.createByOp(exprs, p, ops);
-	}
-  :  p1=xorExpr  {exprs.add($p1.e); p = pos($p1.start);} (op=(Asterisk|ForwardSlash|Percent) p2=xorExpr {exprs.add($p2.e); ops.add($op.text); } )*
-  ;
-
-xorExpr returns [LogicalExpression e]
-	@init{
-	  List<LogicalExpression> exprs = new ArrayList<LogicalExpression>();
-	  List<String> ops = new ArrayList();
-	  ExpressionPosition p = null;
-	}
-	@after{
-	  $e = FunctionCallFactory.createByOp(exprs, p, ops);
-	}
-  :  u1=unaryExpr {exprs.add($u1.e); p = pos($u1.start);} (Caret u2=unaryExpr {exprs.add($u2.e); ops.add($Caret.text);} )*
-  ;
-  
-unaryExpr returns [LogicalExpression e]
-  :  sign=(Plus|Minus)? Number {$e = ValueExpressions.getNumericExpression($sign.text, $Number.text, pos(($sign != null) ? $sign : $Number)); }
-  |  Minus atom {$e = FunctionCallFactory.createExpression("u-", pos($Minus), $atom.e); }
-  |  Excl atom {$e= FunctionCallFactory.createExpression("!", pos($Excl), $atom.e); }
-  |  atom {$e = $atom.e; }
-  ;
-
-atom returns [LogicalExpression e]
-  :  Bool {$e = new ValueExpressions.BooleanExpression($Bool.text, pos($Bool)); }
-  |  lookup {$e = $lookup.e; }
-  ;
-
-pathSegment returns [NameSegment seg]
-  : s1=nameSegment {$seg = $s1.seg;}
-  ;
-
-nameSegment returns [NameSegment seg]
-  : QuotedIdentifier ( (Period s1=pathSegment) | s2=arraySegment)? {$seg = new NameSegment($QuotedIdentifier.text, ($s1.seg == null ? $s2.seg : $s1.seg) ); }
-  | Identifier ( (Period s1=pathSegment) | s2=arraySegment)? {$seg = new NameSegment($Identifier.text, ($s1.seg == null ? $s2.seg : $s1.seg) ); }
-  ;
-  
-arraySegment returns [PathSegment seg]
-  :  OBracket Number CBracket ( (Period s1=pathSegment) | s2=arraySegment)? {$seg = new ArraySegment($Number.text, ($s1.seg == null ? $s2.seg : $s1.seg) ); }
-  ;
-
-
-lookup returns [LogicalExpression e]
-  :  functionCall {$e = $functionCall.e ;}
-  | convertCall {$e = $convertCall.e; }
-  | castCall {$e = $castCall.e; }
-  | pathSegment {$e = new SchemaPath($pathSegment.seg, pos($pathSegment.start) ); }
-  | String {$e = new ValueExpressions.QuotedString($String.text, pos($String) ); }
-  | OParen expression CParen  {$e = $expression.e; }
-  | SingleQuote Identifier SingleQuote {$e = new SchemaPath($Identifier.text, pos($Identifier) ); }
-  ;
-  
-  
-  

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/JSONOptions.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/JSONOptions.java b/common/src/main/java/org/apache/drill/common/JSONOptions.java
deleted file mode 100644
index e432135..0000000
--- a/common/src/main/java/org/apache/drill/common/JSONOptions.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common;
-
-import java.io.IOException;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-
-import org.apache.drill.common.JSONOptions.De;
-import org.apache.drill.common.JSONOptions.Se;
-import org.apache.drill.common.config.DrillConfig;
-import org.apache.drill.common.config.LogicalPlanPersistence;
-import org.apache.drill.common.exceptions.LogicalPlanParsingException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.TreeNode;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.databind.node.TreeTraversingParser;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.google.common.base.Preconditions;
-
-@JsonSerialize(using = Se.class)
-@JsonDeserialize(using = De.class)
-public class JSONOptions {
-
-  private final static Logger logger = LoggerFactory.getLogger(JSONOptions.class);
-
-  private JsonNode root;
-  private JsonLocation location;
-  private Object opaque;
-
-  public JSONOptions(Object opaque) {
-    this.opaque = opaque;
-  }
-
-  public JSONOptions(JsonNode n, JsonLocation location) {
-    this.root = n;
-    this.location = location;
-  }
-
-  @SuppressWarnings("unchecked")
-  public <T> T getWith(LogicalPlanPersistence lpPersistance, Class<T> c) {
-    try {
-      if (opaque != null) {
-        final Class<?> opaqueClass = opaque.getClass();
-        if (opaqueClass.equals(c)) {
-          return (T) opaque;
-        } else {
-          // Enum values that override methods are given $1, $2 ... extensions. Ignore the extension.
-          // e.g. SystemTable$1 for SystemTable.OPTION
-          if (c.isEnum()) {
-            final String opaqueName = opaqueClass.getName().replaceAll("\\$\\d+$", "");
-            final String cName = c.getName();
-            if(opaqueName.equals(cName)) {
-              return (T) opaque;
-            }
-          }
-          throw new IllegalArgumentException(String.format("Attempted to retrieve a option with type of %s.  " +
-            "However, the JSON options carried an opaque value of type %s.", c.getName(), opaqueClass.getName()));
-        }
-      }
-
-      //logger.debug("Read tree {}", root);
-      return lpPersistance.getMapper().treeToValue(root, c);
-    } catch (JsonProcessingException e) {
-      throw new LogicalPlanParsingException(String.format("Failure while trying to convert late bound " +
-        "json options to type of %s. Reference was originally located at line %d, column %d.",
-        c.getCanonicalName(), location.getLineNr(), location.getColumnNr()), e);
-    }
-  }
-
-  public <T> T getListWith(LogicalPlanPersistence config, TypeReference<T> t) throws IOException {
-    return getListWith(config.getMapper(), t);
-  }
-
-  public JsonNode asNode(){
-    Preconditions.checkArgument(this.root != null, "Attempted to grab JSONOptions as JsonNode when no root node was stored.  You can only convert non-opaque JSONOptions values to JsonNodes.");
-    return root;
-  }
-
-  public JsonParser asParser(){
-    Preconditions.checkArgument(this.root != null, "Attempted to grab JSONOptions as Parser when no root node was stored.  You can only convert non-opaque JSONOptions values to parsers.");
-    return new TreeTraversingParser(root);
-  }
-
-  @SuppressWarnings("unchecked")
-  public <T> T getListWith(ObjectMapper mapper, TypeReference<T> t) throws IOException {
-    if (opaque != null) {
-      Type c = t.getType();
-      if (c instanceof ParameterizedType) {
-        c = ((ParameterizedType)c).getRawType();
-      }
-      if ( c.equals(opaque.getClass())) {
-        return (T) opaque;
-      } else {
-        throw new IOException(String.format("Attempted to retrieve a list with type of %s.  However, the JSON " +
-          "options carried an opaque value of type %s.", t.getType(), opaque.getClass().getName()));
-      }
-    }
-    if (root == null) {
-      return null;
-    }
-    return mapper.treeAsTokens(root).readValueAs(t);
-  }
-
-  public JsonNode path(String name) {
-    return root.path(name);
-  }
-
-  public JsonNode getRoot() {
-      return root;
-  }
-
-  public static class De extends StdDeserializer<JSONOptions> {
-
-    public De() {
-      super(JSONOptions.class);
-      logger.debug("Creating Deserializer.");
-    }
-
-    @Override
-    public JSONOptions deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException,
-        JsonProcessingException {
-      JsonLocation l = jp.getTokenLocation();
-//      logger.debug("Reading tree.");
-      TreeNode n = jp.readValueAsTree();
-//      logger.debug("Tree {}", n);
-      if (n instanceof JsonNode) {
-        return new JSONOptions( (JsonNode) n, l);
-      } else {
-        throw new IllegalArgumentException(String.format("Received something other than a JsonNode %s", n));
-      }
-    }
-
-  }
-
-  public static class Se extends StdSerializer<JSONOptions> {
-
-    public Se() {
-      super(JSONOptions.class);
-    }
-
-    @Override
-    public void serialize(JSONOptions value, JsonGenerator jgen, SerializerProvider provider) throws IOException,
-        JsonGenerationException {
-      if (value.opaque != null) {
-        jgen.writeObject(value.opaque);
-      } else {
-        jgen.writeTree(value.root);
-      }
-
-    }
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/SerializedExecutor.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/SerializedExecutor.java b/common/src/main/java/org/apache/drill/common/SerializedExecutor.java
deleted file mode 100644
index 6a3a823..0000000
--- a/common/src/main/java/org/apache/drill/common/SerializedExecutor.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common;
-
-import io.netty.util.Recycler;
-import io.netty.util.Recycler.Handle;
-
-import java.util.LinkedList;
-import java.util.concurrent.Executor;
-
-/**
- * Serializes execution of multiple submissions to a single target, while still
- * using a thread pool to execute those submissions. Provides an implicit
- * queueing capability for a single target that requires any commands that
- * execute against it to be serialized.
- */
-public abstract class SerializedExecutor implements Executor {
-
-  private final Recycler<RunnableProcessor> processors = new Recycler<RunnableProcessor>() {
-    @Override
-    protected RunnableProcessor newObject(Handle handle) {
-      return new RunnableProcessor(handle);
-    }
-  };
-
-  private boolean isProcessing = false;
-  private final LinkedList<Runnable> queuedRunnables = new LinkedList<>();
-  private final Executor underlyingExecutor;
-  private final String name;
-
-  /**
-   * Constructor.
-   *
-   * @param underlyingExecutor
-   *          underlying executor to use to execute commands submitted to this
-   *          SerializedExecutor
-   */
-  public SerializedExecutor(String name, Executor underlyingExecutor) {
-    this.underlyingExecutor = underlyingExecutor;
-    this.name = name;
-  }
-
-  /**
-   * An exception occurred in the last command executed; this reports that to
-   * the subclass of SerializedExecutor.
-   *
-   * <p>
-   * The default implementation of this method throws an exception, which is
-   * considered an error (see below). Implementors have two alternatives:
-   * Arrange not to throw from your commands' run(), or if they do, provide an
-   * override of this method that handles any exception that is thrown.
-   * </p>
-   *
-   * <p>
-   * It is an error for this to throw an exception, and doing so will terminate
-   * the thread with an IllegalStateException. Derivers must handle any reported
-   * exceptions in other ways.
-   * </p>
-   *
-   * @param command
-   *          the command that caused the exception
-   * @param t
-   *          the exception
-   */
-  protected abstract void runException(Runnable command, Throwable t);
-
-  private class RunnableProcessor implements Runnable {
-    private final Handle handle;
-
-    private Runnable command;
-
-    public RunnableProcessor(Handle handle) {
-      this.handle = handle;
-    }
-
-    public Runnable set(Runnable command) {
-      this.command = command;
-      return this;
-    }
-
-    @Override
-    public void run() {
-      final Thread currentThread = Thread.currentThread();
-      final String originalThreadName = currentThread.getName();
-      currentThread.setName(name);
-
-      try {
-        while (true) {
-          try {
-            command.run();
-          } catch (Exception | AssertionError e) {
-            try {
-              runException(command, e);
-            } catch (Exception | AssertionError ee) {
-              throw new IllegalStateException("Exception handler threw an exception", ee);
-            }
-          }
-
-          synchronized (queuedRunnables) {
-            if (queuedRunnables.isEmpty()) {
-              isProcessing = false;
-              break;
-            }
-
-            command = queuedRunnables.removeFirst();
-          }
-        }
-      } finally {
-        currentThread.setName(originalThreadName);
-        command = null;
-        processors.recycle(this, handle);
-      }
-    }
-  }
-
-  @Override
-  public void execute(Runnable command) {
-    synchronized (queuedRunnables) {
-      if (isProcessing) {
-        queuedRunnables.addLast(command);
-        return;
-      }
-
-      isProcessing = true;
-    }
-
-    underlyingExecutor.execute(processors.get().set(command));
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/config/LogicalPlanPersistence.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/config/LogicalPlanPersistence.java b/common/src/main/java/org/apache/drill/common/config/LogicalPlanPersistence.java
deleted file mode 100644
index cd7a8d0..0000000
--- a/common/src/main/java/org/apache/drill/common/config/LogicalPlanPersistence.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.config;
-
-import java.util.Set;
-
-import org.apache.drill.common.expression.LogicalExpression;
-import org.apache.drill.common.expression.SchemaPath;
-import org.apache.drill.common.logical.FormatPluginConfigBase;
-import org.apache.drill.common.logical.StoragePluginConfigBase;
-import org.apache.drill.common.logical.data.LogicalOperatorBase;
-import org.apache.drill.common.scanner.persistence.ScanResult;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser.Feature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-
-public class LogicalPlanPersistence {
-  private ObjectMapper mapper;
-
-  public ObjectMapper getMapper() {
-    return mapper;
-  }
-
-  public LogicalPlanPersistence(DrillConfig conf, ScanResult scanResult) {
-    mapper = new ObjectMapper();
-
-    SimpleModule deserModule = new SimpleModule("LogicalExpressionDeserializationModule")
-        .addDeserializer(LogicalExpression.class, new LogicalExpression.De(conf))
-        .addDeserializer(SchemaPath.class, new SchemaPath.De());
-
-    mapper.registerModule(deserModule);
-    mapper.enable(SerializationFeature.INDENT_OUTPUT);
-    mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
-    mapper.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, true);
-    mapper.configure(Feature.ALLOW_COMMENTS, true);
-    registerSubtypes(LogicalOperatorBase.getSubTypes(scanResult));
-    registerSubtypes(StoragePluginConfigBase.getSubTypes(scanResult));
-    registerSubtypes(FormatPluginConfigBase.getSubTypes(scanResult));
-  }
-
-  private <T> void registerSubtypes(Set<Class<? extends T>> types) {
-    for (Class<? extends T> type : types) {
-      mapper.registerSubtypes(type);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java b/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
deleted file mode 100644
index ae70ffa..0000000
--- a/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.exceptions;
-
-import java.lang.reflect.InvocationTargetException;
-
-public class ExecutionSetupException extends DrillException {
-
-  public static ExecutionSetupException fromThrowable(String message, Throwable cause) {
-    Throwable t = cause instanceof InvocationTargetException
-        ? ((InvocationTargetException)cause).getTargetException() : cause;
-    if (t instanceof ExecutionSetupException) {
-      return ((ExecutionSetupException) t);
-    }
-    return new ExecutionSetupException(message, t);
-  }
-  public ExecutionSetupException() {
-    super();
-
-  }
-
-  public ExecutionSetupException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-
-  }
-
-  public ExecutionSetupException(String message, Throwable cause) {
-    super(message, cause);
-
-  }
-
-  public ExecutionSetupException(String message) {
-    super(message);
-
-  }
-
-  public ExecutionSetupException(Throwable cause) {
-    super(cause);
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/exceptions/ExpressionParsingException.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/exceptions/ExpressionParsingException.java b/common/src/main/java/org/apache/drill/common/exceptions/ExpressionParsingException.java
deleted file mode 100644
index 835182d..0000000
--- a/common/src/main/java/org/apache/drill/common/exceptions/ExpressionParsingException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.exceptions;
-
-public class ExpressionParsingException extends LogicalPlanParsingException {
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExpressionParsingException.class);
-
-  public ExpressionParsingException() {
-    super();
-  }
-
-  public ExpressionParsingException(String message, Throwable cause, boolean enableSuppression,
-      boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-  }
-
-  public ExpressionParsingException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public ExpressionParsingException(String message) {
-    super(message);
-  }
-
-  public ExpressionParsingException(Throwable cause) {
-    super(cause);
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/exceptions/LogicalOperatorValidationException.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/exceptions/LogicalOperatorValidationException.java b/common/src/main/java/org/apache/drill/common/exceptions/LogicalOperatorValidationException.java
deleted file mode 100644
index 3debf28..0000000
--- a/common/src/main/java/org/apache/drill/common/exceptions/LogicalOperatorValidationException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.exceptions;
-
-public class LogicalOperatorValidationException extends LogicalPlanParsingException {
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LogicalOperatorValidationException.class);
-
-  public LogicalOperatorValidationException() {
-    super();
-  }
-
-  public LogicalOperatorValidationException(String message, Throwable cause, boolean enableSuppression,
-      boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-  }
-
-  public LogicalOperatorValidationException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public LogicalOperatorValidationException(String message) {
-    super(message);
-  }
-
-  public LogicalOperatorValidationException(Throwable cause) {
-    super(cause);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/exceptions/LogicalPlanParsingException.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/exceptions/LogicalPlanParsingException.java b/common/src/main/java/org/apache/drill/common/exceptions/LogicalPlanParsingException.java
deleted file mode 100644
index c8c0afa..0000000
--- a/common/src/main/java/org/apache/drill/common/exceptions/LogicalPlanParsingException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.exceptions;
-import org.apache.drill.common.logical.data.LogicalOperator;
-
-public class LogicalPlanParsingException extends DrillRuntimeException{
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LogicalPlanParsingException.class);
-
-  private LogicalOperator operator;
-
-  public LogicalPlanParsingException() {
-    super();
-  }
-
-  public LogicalPlanParsingException(String message, Throwable cause, boolean enableSuppression,
-      boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-  }
-
-  public LogicalPlanParsingException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public LogicalPlanParsingException(String message) {
-    super(message);
-  }
-
-  public LogicalPlanParsingException(Throwable cause) {
-    super(cause);
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/BooleanOperator.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/BooleanOperator.java b/common/src/main/java/org/apache/drill/common/expression/BooleanOperator.java
deleted file mode 100644
index 809d3e2..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/BooleanOperator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.drill.common.expression;
-
-import java.util.List;
-
-import org.apache.drill.common.expression.visitors.ExprVisitor;
-import org.apache.drill.common.types.TypeProtos.DataMode;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.common.types.Types;
-
-public class BooleanOperator extends FunctionCall{
-
-  public BooleanOperator(String name, List<LogicalExpression> args, ExpressionPosition pos) {
-    super(name, args, pos);
-  }
-
-  @Override
-  public <T, V, E extends Exception> T accept(ExprVisitor<T, V, E> visitor, V value) throws E{
-    return visitor.visitBooleanOperator(this, value);
-  }
-
-  @Override
-  public MajorType getMajorType() {
-    // If any of argumgnet of a boolean "and"/"or" is nullable, the result is nullable bit.
-    // Otherwise, it's non-nullable bit.
-    for (LogicalExpression e : args) {
-      if (e.getMajorType().getMode() == DataMode.OPTIONAL) {
-        return Types.OPTIONAL_BIT;
-      }
-    }
-    return Types.REQUIRED_BIT;
-
-  }
-
-  @Override
-  public int getCumulativeCost() {
-    // return the average cost of operands for a boolean "and" | "or"
-    int cost = this.getSelfCost();
-
-    int i = 0;
-    for (LogicalExpression e : this) {
-      cost += e.getCumulativeCost();
-      i++;
-    }
-
-    return (int) (cost / i) ;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/CastExpression.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/CastExpression.java b/common/src/main/java/org/apache/drill/common/expression/CastExpression.java
deleted file mode 100644
index 5d09a24..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/CastExpression.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.apache.drill.common.expression.visitors.ExprVisitor;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public class CastExpression extends LogicalExpressionBase implements Iterable<LogicalExpression>{
-
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CastExpression.class);
-
-  private final LogicalExpression input;
-  private final MajorType type;
-
-  public CastExpression(LogicalExpression input, MajorType type, ExpressionPosition pos) {
-    super(pos);
-    this.input = input;
-    this.type = checkNotNull(type, "Major type cannot be null");
-  }
-
-  @Override
-  public <T, V, E extends Exception> T accept(ExprVisitor<T, V, E> visitor, V value) throws E {
-    return visitor.visitCastExpression(this, value);
-  }
-
-  @Override
-  public Iterator<LogicalExpression> iterator() {
-    return Collections.singleton(input).iterator();
-  }
-
-  public LogicalExpression getInput() {
-    return input;
-  }
-
-  @Override
-  public MajorType getMajorType() {
-    return type;
-  }
-
-  @Override
-  public String toString() {
-    return "CastExpression [input=" + input + ", type=" + type + "]";
-  }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/ConvertExpression.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ConvertExpression.java b/common/src/main/java/org/apache/drill/common/expression/ConvertExpression.java
deleted file mode 100644
index dda97e6..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/ConvertExpression.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.apache.drill.common.expression.visitors.ExprVisitor;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.common.types.Types;
-
-public class ConvertExpression extends LogicalExpressionBase implements Iterable<LogicalExpression>{
-
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ConvertExpression.class);
-
-  public static final String CONVERT_FROM = "convert_from";
-  public static final String CONVERT_TO = "convert_to";
-
-  private final LogicalExpression input;
-  private final MajorType type;
-  private final String convertFunction;
-  private final String encodingType;
-
-  /**
-   * @param encodingType
-   * @param convertFunction
-   * @param input
-   * @param pos
-   */
-  public ConvertExpression(String convertFunction, String encodingType, LogicalExpression input, ExpressionPosition pos) {
-    super(pos);
-    this.input = input;
-    this.convertFunction = CONVERT_FROM.equals(convertFunction.toLowerCase()) ? CONVERT_FROM : CONVERT_TO;
-    this.encodingType = encodingType.toUpperCase();
-    this.type = Types.getMajorTypeFromName(encodingType.split("_", 2)[0].toLowerCase());
-  }
-
-  @Override
-  public <T, V, E extends Exception> T accept(ExprVisitor<T, V, E> visitor, V value) throws E {
-    return visitor.visitConvertExpression(this, value);
-  }
-
-  @Override
-  public Iterator<LogicalExpression> iterator() {
-    return Collections.singleton(input).iterator();
-  }
-
-  public String getConvertFunction() {
-    return convertFunction;
-  }
-
-  public LogicalExpression getInput() {
-    return input;
-  }
-
-  @Override
-  public MajorType getMajorType() {
-    return type;
-  }
-
-  public String getEncodingType() {
-    return encodingType;
-  }
-
-  @Override
-  public String toString() {
-    return "ConvertExpression [input=" + input + ", type=" + Types.toString(type) + ", convertFunction="
-        + convertFunction + ", conversionType=" + encodingType + "]";
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/ErrorCollector.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ErrorCollector.java b/common/src/main/java/org/apache/drill/common/expression/ErrorCollector.java
deleted file mode 100644
index f229e53..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/ErrorCollector.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-import org.apache.drill.common.types.TypeProtos.MajorType;
-
-import com.google.common.collect.Range;
-
-public interface ErrorCollector {
-
-    public void addGeneralError(ExpressionPosition expr, String s);
-
-    public void addUnexpectedArgumentType(ExpressionPosition expr, String name, MajorType actual, MajorType[] expected, int argumentIndex);
-
-    public void addUnexpectedArgumentCount(ExpressionPosition expr, int actual, Range<Integer> expected);
-
-    public void addUnexpectedArgumentCount(ExpressionPosition expr, int actual, int expected);
-
-    public void addNonNumericType(ExpressionPosition expr, MajorType actual);
-
-    public void addUnexpectedType(ExpressionPosition expr, int index, MajorType actual);
-
-    public void addExpectedConstantValue(ExpressionPosition expr, int actual, String s);
-
-    boolean hasErrors();
-
-    public int getErrorCount();
-
-    String toErrorString();
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/ErrorCollectorImpl.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ErrorCollectorImpl.java b/common/src/main/java/org/apache/drill/common/expression/ErrorCollectorImpl.java
deleted file mode 100644
index 4f958ec..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/ErrorCollectorImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.drill.common.expression.visitors.ExpressionValidationError;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Range;
-
-public class ErrorCollectorImpl implements ErrorCollector {
-    List<ExpressionValidationError> errors;
-
-    public ErrorCollectorImpl() {
-        errors = Lists.newArrayList();
-    }
-
-    private String addExpr(ExpressionPosition expr, String message) {
-        return String.format("Error in expression at index %d.  Error: %s.  Full expression: %s.", expr.getCharIndex(), message, expr.getExpression());
-    }
-
-    @Override
-    public void addGeneralError(ExpressionPosition expr, String s) {
-        errors.add(new ExpressionValidationError(addExpr(expr, s)));
-    }
-
-    @Override
-    public void addUnexpectedArgumentType(ExpressionPosition expr, String name, MajorType actual, MajorType[] expected, int argumentIndex) {
-        errors.add(
-                new ExpressionValidationError(
-                        addExpr(expr, String.format(
-                                "Unexpected argument type. Index :%d Name: %s, Type: %s, Expected type(s): %s",
-                                argumentIndex, name, actual, Arrays.toString(expected)
-                        ))
-                )
-        );
-    }
-
-    @Override
-    public void addUnexpectedArgumentCount(ExpressionPosition expr, int actual, Range<Integer> expected) {
-        errors.add(new ExpressionValidationError(
-                addExpr(expr, String.format("Unexpected argument count. Actual argument count: %d, Expected range: %s", actual, expected))
-        ));
-    }
-
-    @Override
-    public void addUnexpectedArgumentCount(ExpressionPosition expr, int actual, int expected) {
-        errors.add(new ExpressionValidationError(
-                addExpr(expr, String.format("Unexpected argument count. Actual argument count: %d, Expected count: %d", actual, expected))
-        ));
-    }
-
-    @Override
-    public void addNonNumericType(ExpressionPosition expr, MajorType actual) {
-        errors.add(new ExpressionValidationError(
-                addExpr(expr, String.format("Unexpected numeric type. Actual type: %s", actual))
-        ));
-    }
-
-    @Override
-    public void addUnexpectedType(ExpressionPosition expr, int index, MajorType actual) {
-        errors.add(new ExpressionValidationError(
-                addExpr(expr, String.format("Unexpected argument type. Actual type: %s, Index: %d", actual, index))
-        ));
-    }
-
-    @Override
-    public void addExpectedConstantValue(ExpressionPosition expr, int actual, String s) {
-        errors.add(new ExpressionValidationError(
-                addExpr(expr, String.format("Unexpected constant value. Name: %s, Actual: %s", s, actual))
-        ));
-    }
-
-    @Override
-    public boolean hasErrors() {
-        return !errors.isEmpty();
-    }
-
-
-    @Override
-    public int getErrorCount() {
-      return errors.size();
-    }
-
-    @Override
-    public String toErrorString() {
-        return "\n" + Joiner.on("\n").join(errors);
-    }
-
-    @Override
-    public String toString() {
-      return toErrorString();
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/ExpressionFunction.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ExpressionFunction.java b/common/src/main/java/org/apache/drill/common/expression/ExpressionFunction.java
deleted file mode 100644
index bc478dd..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/ExpressionFunction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Type;
-import java.util.List;
-
-import org.apache.drill.common.expression.visitors.ExpressionValidationException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.reflect.TypeToken;
-
-@SuppressWarnings("unchecked")
-public class ExpressionFunction {
-  final static Logger logger = LoggerFactory.getLogger(ExpressionFunction.class);
-
-  @SuppressWarnings("serial")
-  final static Type EXPR_LIST = (new TypeToken<List<LogicalExpression>>() {
-  }).getType();
-
-  private static final Class<?>[] FUNCTIONS = {};
-
-  private static final ImmutableMap<String, Constructor<LogicalExpression>> FUNCTION_MAP;
-
-  static {
-    ImmutableMap.Builder<String, Constructor<LogicalExpression>> builder = ImmutableMap.builder();
-    for (Class<?> c : FUNCTIONS) {
-
-      // logger.debug("Adding {} and function", c);
-      if (!LogicalExpression.class.isAssignableFrom(c)) {
-        logger.error(
-            "The provided Class [{}] does not derive from LogicalExpression.  Skipping inclusion in registry.", c);
-        continue;
-      }
-      FunctionName fn = c.getAnnotation(FunctionName.class);
-      if (fn == null) {
-        logger.error(
-            "The provided Class [{}] did not have a FunctionName annotation.  Skipping inclusion in registry.", c);
-        continue;
-      }
-      String name = fn.value();
-      try {
-        Constructor<LogicalExpression> m = (Constructor<LogicalExpression>) c.getConstructor(List.class);
-        if (!EXPR_LIST.equals(m.getGenericParameterTypes()[0])) {
-          logger
-              .error(
-                  "The constructor for each function must have a argument list that only contains a List<LogicalExpression>.  The class[{}] has an inccorect List<{}> argument.",
-                  c, m.getGenericParameterTypes()[0]);
-          continue;
-        }
-
-        builder.put(name, m);
-      } catch (Exception e) {
-        logger
-            .error(
-                "Failure while attempting to retrieve Logical Expression list constructor on class [{}].  Functions must have one of these.",
-                c, e);
-      }
-    }
-
-    FUNCTION_MAP = builder.build();
-  }
-
-  public static LogicalExpression create(String functionName, List<LogicalExpression> expressions)
-      throws ExpressionValidationException {
-    // logger.debug("Requesting generation of new function with name {}.",
-    // functionName);
-    if (!FUNCTION_MAP.containsKey(functionName)) {
-      throw new ExpressionValidationException(String.format("Unknown function with name '%s'", functionName));
-    }
-    try {
-      return FUNCTION_MAP.get(functionName).newInstance(expressions);
-    } catch (Exception e) {
-      throw new ExpressionValidationException("Failure while attempting to build type of " + functionName, e);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/44dea433/common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java b/common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java
deleted file mode 100644
index e3f34f4..0000000
--- a/common/src/main/java/org/apache/drill/common/expression/ExpressionPosition.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.common.expression;
-
-public class ExpressionPosition {
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExpressionPosition.class);
-
-  public static final ExpressionPosition UNKNOWN = new ExpressionPosition("--UNKNOWN EXPRESSION--", -1);
-
-  private final String expression;
-  private final int charIndex;
-
-  public ExpressionPosition(String expression, int charIndex) {
-    super();
-    this.expression = expression;
-    this.charIndex = charIndex;
-  }
-
-  @Override
-  public String toString() {
-    return super.toString()
-           + "[charIndex = " + charIndex + ", expression = " + expression + "]";
-  }
-
-  public String getExpression() {
-    return expression;
-  }
-
-  public int getCharIndex() {
-    return charIndex;
-  }
-
-
-
-}


Mime
View raw message