Class SplunkPushDownRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.adapter.splunk.SplunkPushDownRule
-
public class SplunkPushDownRule extends RelOptRule
Planner rule to push filters and projections to Splunk.
-
-
Field Summary
Fields Modifier and Type Field Description static SplunkPushDownRule
FILTER
static SplunkPushDownRule
FILTER_ON_PROJECT
private static org.slf4j.Logger
LOGGER
static SplunkPushDownRule
PROJECT
static SplunkPushDownRule
PROJECT_ON_FILTER
private static java.util.Set<SqlKind>
SUPPORTED_OPS
-
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SplunkPushDownRule(RelOptRuleOperand rule, java.lang.String id)
Deprecated.protected
SplunkPushDownRule(RelOptRuleOperand rule, RelBuilderFactory relBuilderFactory, java.lang.String id)
Creates a SplunkPushDownRule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static RelNode
addProjectionRule(LogicalProject proj, RelNode rel)
protected RelNode
appendSearchString(java.lang.String toAppend, SplunkTableScan splunkRel, LogicalProject topProj, LogicalProject bottomProj, RelDataType topRow, RelDataType bottomRow)
Appends a search string.private boolean
asd(boolean like, java.util.List<RexNode> operands, java.lang.StringBuilder s, java.util.List<java.lang.String> fieldNames, int i)
static java.lang.String
getFieldsString(RelDataType row)
private boolean
getFilter(SqlOperator op, java.util.List<RexNode> operands, java.lang.StringBuilder s, java.util.List<java.lang.String> fieldNames)
void
onMatch(RelOptRuleCall call)
Receives notification about a rule match.static java.lang.String
searchEscape(java.lang.String str)
private java.lang.String
toString(boolean like, RexLiteral literal)
private java.lang.String
toString(SqlOperator op)
protected void
transformToFarragoUdxRel(RelOptRuleCall call, SplunkTableScan splunkRel, LogicalFilter filter, LogicalProject topProj, LogicalProject bottomProj)
private boolean
valid(SqlKind kind)
-
Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
SUPPORTED_OPS
private static final java.util.Set<SqlKind> SUPPORTED_OPS
-
PROJECT_ON_FILTER
public static final SplunkPushDownRule PROJECT_ON_FILTER
-
FILTER_ON_PROJECT
public static final SplunkPushDownRule FILTER_ON_PROJECT
-
FILTER
public static final SplunkPushDownRule FILTER
-
PROJECT
public static final SplunkPushDownRule PROJECT
-
-
Constructor Detail
-
SplunkPushDownRule
@Deprecated protected SplunkPushDownRule(RelOptRuleOperand rule, java.lang.String id)
Deprecated.
-
SplunkPushDownRule
protected SplunkPushDownRule(RelOptRuleOperand rule, RelBuilderFactory relBuilderFactory, java.lang.String id)
Creates a SplunkPushDownRule.
-
-
Method Detail
-
onMatch
public void onMatch(RelOptRuleCall call)
Description copied from class:RelOptRule
Receives notification about a rule match. At the time that this method is called,call.rels
holds the set of relational expressions which match the operands to the rule;call.rels[0]
is the root expression.Typically a rule would check that the nodes are valid matches, creates a new expression, then calls back
RelOptRuleCall.transformTo(org.apache.calcite.rel.RelNode, java.util.Map<org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode>)
to register the expression.- Specified by:
onMatch
in classRelOptRule
- Parameters:
call
- Rule call- See Also:
RelOptRule.matches(RelOptRuleCall)
-
appendSearchString
protected RelNode appendSearchString(java.lang.String toAppend, SplunkTableScan splunkRel, LogicalProject topProj, LogicalProject bottomProj, RelDataType topRow, RelDataType bottomRow)
Appends a search string.- Parameters:
toAppend
- Search string to appendsplunkRel
- Relational expressiontopProj
- Top projectionbottomProj
- Bottom projection
-
addProjectionRule
private static RelNode addProjectionRule(LogicalProject proj, RelNode rel)
-
getFilter
private boolean getFilter(SqlOperator op, java.util.List<RexNode> operands, java.lang.StringBuilder s, java.util.List<java.lang.String> fieldNames)
-
asd
private boolean asd(boolean like, java.util.List<RexNode> operands, java.lang.StringBuilder s, java.util.List<java.lang.String> fieldNames, int i)
-
valid
private boolean valid(SqlKind kind)
-
toString
private java.lang.String toString(SqlOperator op)
-
searchEscape
public static java.lang.String searchEscape(java.lang.String str)
-
toString
private java.lang.String toString(boolean like, RexLiteral literal)
-
transformToFarragoUdxRel
protected void transformToFarragoUdxRel(RelOptRuleCall call, SplunkTableScan splunkRel, LogicalFilter filter, LogicalProject topProj, LogicalProject bottomProj)
-
getFieldsString
public static java.lang.String getFieldsString(RelDataType row)
-
-