public class ConvertCountToDirectScan extends Prule
This rule will convert " select count(*) as mycount from table " or " select count(not-nullable-expr) as mycount from table " into
Project(mycount)
\
DirectGroupScan ( PojoRecordReader ( rowCount ))
or " select count(column) as mycount from table " into
Project(mycount)
\
DirectGroupScan (PojoRecordReader (columnValueCount))
Rule can be applied if query contains multiple count expressions.
" select count(column1), count(column2), count(*) from table "
Currently, only parquet group scan has the exact row count and column value count, obtained from parquet row group info. This will save the cost to scan the whole parquet files.
| Modifier and Type | Field and Description |
|---|---|
static org.apache.calcite.plan.RelOptRule |
AGG_ON_PROJ_ON_SCAN |
static org.apache.calcite.plan.RelOptRule |
AGG_ON_SCAN |
| Modifier | Constructor and Description |
|---|---|
protected |
ConvertCountToDirectScan(org.apache.calcite.plan.RelOptRuleOperand rule,
String id)
Creates a SplunkPushDownRule.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onMatch(org.apache.calcite.plan.RelOptRuleCall call) |
convert, isSingleModepublic static final org.apache.calcite.plan.RelOptRule AGG_ON_PROJ_ON_SCAN
public static final org.apache.calcite.plan.RelOptRule AGG_ON_SCAN
protected ConvertCountToDirectScan(org.apache.calcite.plan.RelOptRuleOperand rule,
String id)
Copyright © 2017 The Apache Software Foundation. All rights reserved.