public static class HiveRewriteToDataSketchesRules.NTileRewrite extends HiveRewriteToDataSketchesRules.AbstractRankBasedRewriteRule
ntile(n) over (order by id)
.
SELECT id, NTILE(4) OVER (ORDER BY id) FROM sketch_input; ⇒ SELECT id, CASE WHEN CEIL(ds_kll_cdf(ds, CAST(id AS FLOAT) )[0]) < 1 THEN 1 ELSE CEIL(ds_kll_cdf(ds, CAST(id AS FLOAT) )[0]) END FROM sketch_input JOIN ( SELECT ds_kll_sketch(CAST(id AS FLOAT)) AS ds FROM sketch_input ) q;
HiveRewriteToDataSketchesRules.AbstractRankBasedRewriteRule.AbstractRankBasedRewriteBuilder
Constructor and Description |
---|
NTileRewrite(String sketchType) |
Modifier and Type | Method and Description |
---|---|
protected HiveRewriteToDataSketchesRules.WindowingToProjectAggregateJoinProject.VbuilderPAP |
buildProcessor(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
public NTileRewrite(String sketchType)
protected HiveRewriteToDataSketchesRules.WindowingToProjectAggregateJoinProject.VbuilderPAP buildProcessor(org.apache.calcite.plan.RelOptRuleCall call)
Copyright © 2022 The Apache Software Foundation. All rights reserved.