Class ExpressionStringBuilder
java.lang.Object
org.apache.drill.common.expression.visitors.AbstractExprVisitor<Void,StringBuilder,RuntimeException>
org.apache.drill.common.expression.ExpressionStringBuilder
- All Implemented Interfaces:
ExprVisitor<Void,
StringBuilder, RuntimeException>
public class ExpressionStringBuilder
extends AbstractExprVisitor<Void,StringBuilder,RuntimeException>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
escapeBackTick
(String input) static String
escapeSingleQuote
(String input) static String
toString
(LogicalExpression expr) static void
toString
(LogicalExpression expr, StringBuilder sb) visitFunctionCall
(FunctionCall call, StringBuilder sb) visitIfExpression
(IfExpression ifExpr, StringBuilder sb) visitIntConstant
(ValueExpressions.IntExpression intExpr, StringBuilder sb) visitSchemaPath
(SchemaPath path, StringBuilder sb) Handles implementation-specific expressions not known to the visitor structure.Methods inherited from class org.apache.drill.common.expression.visitors.AbstractExprVisitor
visitParameter, visitTypedFieldExpr
-
Constructor Details
-
ExpressionStringBuilder
public ExpressionStringBuilder()
-
-
Method Details
-
toString
-
toString
-
escapeSingleQuote
-
escapeBackTick
-
visitFunctionCall
- Specified by:
visitFunctionCall
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitFunctionCall
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitBooleanOperator
- Specified by:
visitBooleanOperator
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitBooleanOperator
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitFunctionHolderExpression
public Void visitFunctionHolderExpression(FunctionHolderExpression holder, StringBuilder sb) throws RuntimeException - Specified by:
visitFunctionHolderExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitFunctionHolderExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitIfExpression
- Specified by:
visitIfExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitIfExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitSchemaPath
- Specified by:
visitSchemaPath
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitSchemaPath
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitLongConstant
public Void visitLongConstant(ValueExpressions.LongExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitLongConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitLongConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDateConstant
public Void visitDateConstant(ValueExpressions.DateExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDateConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDateConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitTimeConstant
public Void visitTimeConstant(ValueExpressions.TimeExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitTimeConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitTimeConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitTimeStampConstant
public Void visitTimeStampConstant(ValueExpressions.TimeStampExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitTimeStampConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitTimeStampConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitIntervalYearConstant
public Void visitIntervalYearConstant(ValueExpressions.IntervalYearExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitIntervalYearConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitIntervalYearConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitIntervalDayConstant
public Void visitIntervalDayConstant(ValueExpressions.IntervalDayExpression lExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitIntervalDayConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitIntervalDayConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDecimal9Constant
public Void visitDecimal9Constant(ValueExpressions.Decimal9Expression decExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDecimal9Constant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDecimal9Constant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDecimal18Constant
public Void visitDecimal18Constant(ValueExpressions.Decimal18Expression decExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDecimal18Constant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDecimal18Constant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDecimal28Constant
public Void visitDecimal28Constant(ValueExpressions.Decimal28Expression decExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDecimal28Constant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDecimal28Constant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDecimal38Constant
public Void visitDecimal38Constant(ValueExpressions.Decimal38Expression decExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDecimal38Constant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDecimal38Constant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitVarDecimalConstant
public Void visitVarDecimalConstant(ValueExpressions.VarDecimalExpression decExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitVarDecimalConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitVarDecimalConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitDoubleConstant
public Void visitDoubleConstant(ValueExpressions.DoubleExpression dExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitDoubleConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitDoubleConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitBooleanConstant
public Void visitBooleanConstant(ValueExpressions.BooleanExpression e, StringBuilder sb) throws RuntimeException - Specified by:
visitBooleanConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitBooleanConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitQuotedStringConstant
public Void visitQuotedStringConstant(ValueExpressions.QuotedString e, StringBuilder sb) throws RuntimeException - Specified by:
visitQuotedStringConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitQuotedStringConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitConvertExpression
- Specified by:
visitConvertExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitConvertExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitAnyValueExpression
- Specified by:
visitAnyValueExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitAnyValueExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitCastExpression
- Specified by:
visitCastExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitCastExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitFloatConstant
public Void visitFloatConstant(ValueExpressions.FloatExpression fExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitFloatConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitFloatConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitIntConstant
public Void visitIntConstant(ValueExpressions.IntExpression intExpr, StringBuilder sb) throws RuntimeException - Specified by:
visitIntConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitIntConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitNullConstant
- Specified by:
visitNullConstant
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitNullConstant
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitNullExpression
- Specified by:
visitNullExpression
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitNullExpression
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException> - Throws:
RuntimeException
-
visitUnknown
Description copied from class:AbstractExprVisitor
Handles implementation-specific expressions not known to the visitor structure. Since there are no "visitFoo" methods for these "unknown" expressions, subclassses should use the functionally-equivalentinstanceof
approach to parse out these "unknown" expressions.- Specified by:
visitUnknown
in interfaceExprVisitor<Void,
StringBuilder, RuntimeException> - Overrides:
visitUnknown
in classAbstractExprVisitor<Void,
StringBuilder, RuntimeException>
-