Skip to content

Commit

Permalink
add changes for DoublesSketchListArgBaseOperatorConversion
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshSingla committed Oct 31, 2023
1 parent 4d1cdfa commit 1979bcb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFail
final RelDataType operandType = callBinding.getValidator().deriveType(callBinding.getScope(), operand);

// Verify that 'operand' is a literal number.
if (!SqlUtil.isLiteral(operand)) {
if (!SqlUtil.isLiteral(operand, true)) {
return OperatorConversions.throwOrReturn(
throwOnFailure,
callBinding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ public void testDoublesSketchPostAggs()
+ " DS_GET_QUANTILE(DS_QUANTILES_SKETCH(cnt + 123), 0.5) + 1000,\n"
+ " ABS(DS_GET_QUANTILE(DS_QUANTILES_SKETCH(cnt), 0.5)),\n"
+ " DS_GET_QUANTILES(DS_QUANTILES_SKETCH(cnt), 0.5, 0.8),\n"
+ " DS_GET_QUANTILES(DS_QUANTILES_SKETCH(cnt), CAST(0.5 AS DOUBLE), CAST(0.8 AS DOUBLE)),\n"
+ " DS_HISTOGRAM(DS_QUANTILES_SKETCH(cnt), 0.2, 0.6),\n"
+ " DS_RANK(DS_QUANTILES_SKETCH(cnt), 3),\n"
+ " DS_CDF(DS_QUANTILES_SKETCH(cnt), 0.2, 0.6),\n"
Expand Down Expand Up @@ -588,41 +589,49 @@ public void testDoublesSketchPostAggs()
),
new double[]{0.5d, 0.8d}
),
new DoublesSketchToHistogramPostAggregator(
new DoublesSketchToQuantilesPostAggregator(
"p13",
new FieldAccessPostAggregator(
"p12",
"a2:agg"
),
new double[]{0.5d, 0.8d}
),
new DoublesSketchToHistogramPostAggregator(
"p15",
new FieldAccessPostAggregator(
"p14",
"a2:agg"
),
new double[]{0.2d, 0.6d},
null
),
new DoublesSketchToRankPostAggregator(
"p15",
"p17",
new FieldAccessPostAggregator(
"p14",
"p16",
"a2:agg"
),
3.0d
),
new DoublesSketchToCDFPostAggregator(
"p17",
"p19",
new FieldAccessPostAggregator(
"p16",
"p18",
"a2:agg"
),
new double[]{0.2d, 0.6d}
),
new DoublesSketchToStringPostAggregator(
"p19",
"p21",
new FieldAccessPostAggregator(
"p18",
"p20",
"a2:agg"
)
),
new ExpressionPostAggregator(
"p20",
"replace(replace(\"p19\",'HeapCompactDoublesSketch','HeapUpdateDoublesSketch'),"
"p22",
"replace(replace(\"p21\",'HeapCompactDoublesSketch','HeapUpdateDoublesSketch'),"
+ "'Combined Buffer Capacity : 6',"
+ "'Combined Buffer Capacity : 8')",
null,
Expand All @@ -640,6 +649,7 @@ public void testDoublesSketchPostAggs()
1124.0d,
1.0d,
"[1.0,1.0]",
"[1.0,1.0]",
"[0.0,0.0,6.0]",
1.0d,
"[0.0,0.0,1.0]",
Expand Down

0 comments on commit 1979bcb

Please sign in to comment.