Skip to content

Commit 8012693

Browse files
committed
chore (isthmus): fix regression
1 parent e739184 commit 8012693

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

isthmus/src/main/java/io/substrait/isthmus/expression/FunctionConverter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.Collections;
2626
import java.util.HashMap;
2727
import java.util.HashSet;
28-
import java.util.IdentityHashMap;
2928
import java.util.List;
3029
import java.util.Locale;
3130
import java.util.Map;
@@ -129,8 +128,7 @@ public FunctionConverter(
129128
.collect(
130129
Multimaps.toMultimap(
131130
FunctionMappings.Sig::name, Function.identity(), ArrayListMultimap::create));
132-
IdentityHashMap<SqlOperator, FunctionFinder> matcherMap =
133-
new IdentityHashMap<SqlOperator, FunctionFinder>();
131+
Map<SqlOperator, FunctionFinder> matcherMap = new HashMap<>();
134132
for (String key : nameToFn.keySet()) {
135133
Collection<Sig> sigs = calciteOperators.get(key);
136134
if (sigs.isEmpty()) {

isthmus/src/test/java/io/substrait/isthmus/UdfSqlSubstraitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ void customUdfTest() throws Exception {
2323
"CREATE TABLE t(x VARCHAR NOT NULL)");
2424

2525
assertSqlSubstraitRelRoundTripWorkaroundOptimizer(
26-
"SELECT regexp_extract(x, 'ab') from t", catalogReader);
26+
"SELECT regexp_extract_custom(x, 'ab') from t", catalogReader);
2727
assertSqlSubstraitRelRoundTripWorkaroundOptimizer(
2828
"SELECT format_text('UPPER', x) FROM t", catalogReader);
2929
assertSqlSubstraitRelRoundTripWorkaroundOptimizer(
3030
"SELECT system_property_get(x) FROM t", catalogReader);
3131
assertSqlSubstraitRelRoundTripWorkaroundOptimizer(
32-
"SELECT safe_divide(10,0) FROM t", catalogReader);
32+
"SELECT safe_divide_custom(10,0) FROM t", catalogReader);
3333
}
3434

3535
private static SimpleExtension.ExtensionCollection loadExtensions(

isthmus/src/test/resources/extensions/scalar_functions_custom.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
---
33
urn: extension:substrait:functions_custom
44
scalar_functions:
5-
- name: "regexp_extract"
5+
- name: "regexp_extract_custom"
66
impls:
77
- args:
88
- name: "text"
@@ -33,7 +33,7 @@ scalar_functions:
3333
return: string?
3434
nullability: DECLARED_OUTPUT
3535

36-
- name: "safe_divide"
36+
- name: "safe_divide_custom"
3737
description: "Performs division, returning NULL if the denominator is zero."
3838
impls:
3939
- args:

0 commit comments

Comments
 (0)