Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public void testSubqueryWithNestedGroupBy()
.intervals(querySegmentSpec(Intervals.ETERNITY))
.virtualColumns(
new ExpressionVirtualColumn("v0", "946684800000", ColumnType.LONG, TestExprMacroTable.INSTANCE),
new ExpressionVirtualColumn("v1", "case_searched((\"j0.a0\" < \"_a0\"),'val2',((\"j0.a0\" >= \"_a0\") && (\"j0.a0\" < \"_a1\")),'val3',(\"j0.a0\" >= \"_a1\"),'val1',null)", ColumnType.STRING, TestExprMacroTable.INSTANCE)
new ExpressionVirtualColumn("v1", "case_searched((CAST(\"j0.a0\", 'DOUBLE') < \"_a0\"),'val2',((CAST(\"j0.a0\", 'DOUBLE') >= \"_a0\") && (CAST(\"j0.a0\", 'DOUBLE') < \"_a1\")),'val3',(CAST(\"j0.a0\", 'DOUBLE') >= \"_a1\"),'val1',null)", ColumnType.STRING, TestExprMacroTable.INSTANCE)
)
.columns("v0", "j0.d0", "j0.a0", "v1")
.columnTypes(ColumnType.LONG, ColumnType.STRING, ColumnType.LONG, ColumnType.STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void testSleepFunction()
)
.columns("v0")
.columnTypes(ColumnType.STRING)
.filters(range("m1", ColumnType.DOUBLE, null, 2.0, false, true))
.filters(range("m1", ColumnType.FLOAT, null, 2.0, false, true))
.resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
.context(QUERY_CONTEXT_DEFAULT)
.build()
Expand Down
4 changes: 2 additions & 2 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ name: Apache Calcite
license_category: binary
module: java-core
license_name: Apache License version 2.0
version: 1.37.0
version: 1.41.0
libraries:
- org.apache.calcite: calcite-core
- org.apache.calcite: calcite-linq4j
Expand Down Expand Up @@ -3535,7 +3535,7 @@ name: Checker Qual
license_category: binary
module: java-core
license_name: MIT License
version: 3.48.1
version: 3.49.2
copyright: the Checker Framework developers
license_file_path: licenses/bin/checker-qual.MIT
libraries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testHavingOnDsHll()
new HllSketchBuildAggregatorFactory("a0", "m1", 12, "HLL_4", null, false, true)
)
)
.setHavingSpec(having(expressionFilter(("(hll_sketch_estimate(\"a0\") > 1)"))))
.setHavingSpec(having(expressionFilter(("(hll_sketch_estimate(\"a0\") > 1.0)"))))
.setContext(DEFAULT_MSQ_CONTEXT)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,17 +967,16 @@ public void testWindowOnFooWithPartitionByOrderBYWithJoin()
newScanQueryBuilder()
.dataSource(CalciteTests.DATASOURCE1)
.intervals(querySegmentSpec(Filtration.eternity()))
.virtualColumns(expressionVirtualColumn("v0", "\"m2\"", ColumnType.FLOAT))
.columns("m2", "v0")
.columnTypes(ColumnType.DOUBLE, ColumnType.FLOAT)
.columns("m2")
.columnTypes(ColumnType.DOUBLE)
.resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
.context(DEFAULT_MSQ_CONTEXT)
.build()
),
"j0.",
equalsCondition(
DruidExpression.ofColumn(ColumnType.FLOAT, "m1"),
DruidExpression.ofColumn(ColumnType.FLOAT, "j0.v0")
DruidExpression.ofColumn(ColumnType.DOUBLE, "j0.m2")
),
JoinType.INNER
)
Expand Down Expand Up @@ -1054,17 +1053,16 @@ public void testWindowOnFooWithEmptyOverWithJoin()
newScanQueryBuilder()
.dataSource(CalciteTests.DATASOURCE1)
.intervals(querySegmentSpec(Filtration.eternity()))
.virtualColumns(expressionVirtualColumn("v0", "\"m2\"", ColumnType.FLOAT))
.columns("m2", "v0")
.columnTypes(ColumnType.DOUBLE, ColumnType.FLOAT)
.columns("m2")
.columnTypes(ColumnType.DOUBLE)
.resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
.context(DEFAULT_MSQ_CONTEXT)
.build()
),
"j0.",
equalsCondition(
DruidExpression.ofColumn(ColumnType.FLOAT, "m1"),
DruidExpression.ofColumn(ColumnType.FLOAT, "j0.v0")
DruidExpression.ofColumn(ColumnType.DOUBLE, "j0.m2")
),
JoinType.INNER
)
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<!--
The base calcite parser was copied into the project; when updating Calcite run dev/upgrade-calcite-parser to adopt upstream changes
-->
<calcite.version>1.37.0</calcite.version>
<calcite.version>1.41.0</calcite.version>
<confluent.version>6.2.15</confluent.version>
<cronutils.version>9.2.0</cronutils.version>
<datasketches.version>4.2.0</datasketches.version>
Expand Down Expand Up @@ -132,7 +132,7 @@
<okhttp.version>5.3.2</okhttp.version>
<kubernetes.client.version>25.0.0-legacy</kubernetes.client.version>
<zookeeper.version>3.8.6</zookeeper.version>
<checkerframework.version>3.48.1</checkerframework.version>
<checkerframework.version>3.49.2</checkerframework.version>
<com.google.apis.client.version>2.2.0</com.google.apis.client.version>
<com.google.http.client.apis.version>1.42.3</com.google.http.client.apis.version>
<com.google.apis.compute.version>v1-rev20230606-2.0.0</com.google.apis.compute.version>
Expand Down Expand Up @@ -1288,7 +1288,7 @@
<dependency>
<groupId>net.hydromatic</groupId>
<artifactId>quidem</artifactId>
<version>0.11</version>
<version>0.12</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
11 changes: 11 additions & 0 deletions processing/src/main/java/org/apache/druid/math/expr/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,17 @@ public void validateArguments(List<Expr> args)
validationHelperCheckMinArgumentCount(args, 2);
}

@Override
public Set<Expr> getScalarInputs(List<Expr> args)
{
// Only the WHEN args must be scalars. The THEN and ELSE args can be arrays.
final ImmutableSet.Builder<Expr> conditions = ImmutableSet.builder();
for (int i = 0; i + 1 < args.size(); i += 2) {
conditions.add(args.get(i));
}
return conditions.build();
}

@Nullable
@Override
public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List<Expr> args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ FROM test_agg_funcs;
# TESTCASE: test003 TEST_ID: A01
#-------------------------------------------------------------------------
SELECT array_agg(111.1111111, 100000) AS col;
is not supported
!error
+---------------+
| col |
+---------------+
| [111.1111111] |
+---------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ FROM test_agg_funcs;
# TESTCASE: test004 TEST_ID: A01
#-------------------------------------------------------------------------
SELECT array_agg(111.1111111, 100000);
is not supported
!error
+---------------+
| EXPR$0 |
+---------------+
| [111.1111111] |
+---------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ FROM test_agg_funcs;
# TESTCASE: test003 TEST_ID: A01
#-------------------------------------------------------------------------
SELECT array_agg(11.1111111, 100000) AS col;
is not supported
!error
+--------------+
| col |
+--------------+
| [11.1111111] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ FROM test_agg_funcs;
# TESTCASE: test004 TEST_ID: A01
#-------------------------------------------------------------------------
SELECT array_agg(11.1111111, 100000);
is not supported
!error
+--------------+
| EXPR$0 |
+--------------+
| [11.1111111] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ SELECT array[1111111111,
# TESTCASE: test003 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(DISTINCT 1111111111, 100000) AS col;
is not supported
!error
+--------------+
| col |
+--------------+
| [1111111111] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ SELECT array[1111111111,
# TESTCASE: test004 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(1111111111, 100000) AS col;
is not supported
!error
+--------------+
| col |
+--------------+
| [1111111111] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ SELECT array['AAAAAAAAAA',
# TESTCASE: test003 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(DISTINCT 'AAAAAAAAAA', 100000) AS col;
is not supported
!error
+--------------+
| col |
+--------------+
| [AAAAAAAAAA] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ SELECT array['AAAAAAAAAA',
# TESTCASE: test004 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg('AAAAAAAAAA', 100000) AS col;
is not supported
!error
+--------------+
| col |
+--------------+
| [AAAAAAAAAA] |
+--------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test003 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(DISTINCT timestamp '2020-01-01 01:01:01.000', 100000) AS col;
is not supported
!error
+-----------------------+
| col |
+-----------------------+
| [2020-01-01 01:01:01] |
+-----------------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test003 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(DISTINCT timestamp '2020-01-01 01:01:01.000', 100000) AS col;
is not supported
!error
+-----------------+
| col |
+-----------------+
| [1577840461000] |
+-----------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test003 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(DISTINCT timestamp '2020-01-01 01:01:01.000', 100000) AS col;
is not supported
!error
+-----------------------+
| col |
+-----------------------+
| [2020-01-01 01:01:01] |
+-----------------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test003 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test004 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(timestamp '2020-01-01 01:01:01.000', 100000);
is not supported
!error
+-----------------------+
| EXPR$0 |
+-----------------------+
| [2020-01-01 01:01:01] |
+-----------------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test004 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(timestamp '2020-01-01 01:01:01.000', 100000);
is not supported
!error
+-----------------+
| EXPR$0 |
+-----------------+
| [1577840461000] |
+-----------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ SELECT array[timestamp '2020-01-01 01:01:01.000', timestamp '2020-02-01 01:01:01
# TESTCASE: test004 TEST_ID: A02
#-------------------------------------------------------------------------
SELECT array_agg(timestamp '2020-01-01 01:01:01.000', 100000);
is not supported
!error
+-----------------------+
| EXPR$0 |
+-----------------------+
| [2020-01-01 01:01:01] |
+-----------------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test004 TEST_ID: A03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ FROM test_agg_funcs;
# TESTCASE: test001 TEST_ID: A01
#-------------------------------------------------------------------------
SELECT string_agg(111.1111111, '|') AS col;
QueryInterruptedException
!error
+-------------+
| col |
+-------------+
| 111.1111111 |
+-------------+
(1 row)

!ok

#-------------------------------------------------------------------------
# TESTCASE: test001 TEST_ID: A02
Expand Down
Loading
Loading