Skip to content

Commit a33cac7

Browse files
authored
Add dedicated mv_overlap, mv_contains functions. (#18084)
* Add dedicated mv_overlap, mv_contains functions. Introduces new multi-value string functions at the native layer. These are now used for the SQL `MV_OVERLAP` and `MV_CONTAINS` functions. The main purpose of the new functions is to have slightly different null and empty-array handling behavior vs `array_overlap` and `array_contains`. Behavior is designed to align with the native `inType` filter, which is especially important for `MV_OVERLAP`, because the SQL layer can convert `MV_OVERLAP` into an `inType` filter. The SQL layer no longer generates calls to the `mv_harmonize_nulls` function, because that logic has been moved inside `mv_overlap` and `mv_contains`. The function still remains at the native layer for backwards compatibility. * Remove unused variables. * Update quidem-ut tests. * Additional tests in FunctionTest. * Remove unneeded code. * Ensure we don't use the array element filter for MV_CONTAINS. * Fix array constructor type detection. * Cast second arg to string array. * Remove unnecessary overrides of DirectOperatorConversion stuff. * Code cleanup
1 parent b413e9e commit a33cac7

File tree

35 files changed

+1132
-687
lines changed

35 files changed

+1132
-687
lines changed

extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/filter/sql/BloomFilterOperatorConversion.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.apache.calcite.rex.RexLiteral;
2424
import org.apache.calcite.rex.RexNode;
2525
import org.apache.calcite.sql.SqlFunction;
26-
import org.apache.calcite.sql.SqlOperator;
2726
import org.apache.calcite.sql.type.ReturnTypes;
2827
import org.apache.calcite.sql.type.SqlTypeFamily;
2928
import org.apache.druid.guice.BloomFilterSerializersModule;
@@ -58,12 +57,6 @@ public BloomFilterOperatorConversion()
5857
super(SQL_FUNCTION, BloomFilterExpressions.TestExprMacro.FN_NAME);
5958
}
6059

61-
@Override
62-
public SqlOperator calciteOperator()
63-
{
64-
return SQL_FUNCTION;
65-
}
66-
6760
@Nullable
6861
@Override
6962
public DimFilter toDruidFilter(

0 commit comments

Comments
 (0)