Skip to content

Commit 51ba237

Browse files
authored
Merge pull request #557 from mspruc/main
increase calcite version & fix deprecated method
2 parents 24fa033 + 549ee22 commit 51ba237

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

wayang-api/wayang-api-sql/pom.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,26 @@
2626
</parent>
2727
<modelVersion>4.0.0</modelVersion>
2828

29+
<properties>
30+
<calcite.version>1.39.0</calcite.version>
31+
</properties>
32+
2933
<artifactId>wayang-api-sql</artifactId>
3034
<dependencies>
3135
<dependency>
3236
<groupId>org.apache.calcite</groupId>
3337
<artifactId>calcite-core</artifactId>
34-
<version>1.32.0</version>
38+
<version>${calcite.version}</version>
3539
</dependency>
3640
<dependency>
3741
<groupId>org.apache.calcite</groupId>
3842
<artifactId>calcite-linq4j</artifactId>
39-
<version>1.32.0</version>
43+
<version>${calcite.version}</version>
4044
</dependency>
4145
<dependency>
4246
<groupId>org.apache.calcite</groupId>
4347
<artifactId>calcite-file</artifactId>
44-
<version>1.29.0</version>
48+
<version>${calcite.version}</version>
4549
</dependency>
4650
<dependency>
4751
<groupId>org.apache.wayang</groupId>

wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/calcite/converter/functions/FilterEvaluateCondition.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public boolean eval(final Record record, final SqlKind kind, final RexNode leftO
7878

7979
switch (kind) {
8080
case LIKE:
81-
return SqlFunctions.like(field.toString(), rexLiteral.toString().replace("'", ""));
81+
return like(field.toString(), rexLiteral.toString().replace("'", ""));
8282
case GREATER_THAN:
8383
return isGreaterThan(field, rexLiteral);
8484
case LESS_THAN:
@@ -127,6 +127,13 @@ public boolean eval(final Record record, final SqlKind kind, final RexNode leftO
127127
}
128128
}
129129

130+
private boolean like(final String s1, final String s2) {
131+
final SqlFunctions.LikeFunction likeFunction = new SqlFunctions.LikeFunction();
132+
final boolean isMatch = likeFunction.like(s1, s2);
133+
134+
return isMatch;
135+
}
136+
130137
private boolean isGreaterThan(final Object o, final RexLiteral rexLiteral) {
131138
// return rexLiteral.getValue().compareTo(o)< 0;
132139
return ((Comparable) o).compareTo(rexLiteral.getValueAs(o.getClass())) > 0;

0 commit comments

Comments
 (0)