public class ConvertCountToDirectScanRule
extends org.apache.calcite.plan.RelOptRule
This rule is a logical planning counterpart to a corresponding ConvertCountToDirectScanPrule physical rule
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 "
The rule utilizes the Parquet Metadata Cache's summary information to retrieve the total row count and the per-column null count. As such, the rule is only applicable for Parquet tables and only if the metadata cache has been created with the summary information.
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 and Type | Method and Description |
---|---|
void |
onMatch(org.apache.calcite.plan.RelOptRuleCall call) |
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
Copyright © 1970 The Apache Software Foundation. All rights reserved.