Skip to content

Commit 0bdc673

Browse files
committed
Bump calcite dependency to 1.39.0
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 5991c99 commit 0bdc673

5 files changed

Lines changed: 6 additions & 61 deletions

File tree

core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ dependencies {
5757
api group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
5858
api group: 'com.tdunning', name: 't-digest', version: '3.3'
5959
api "net.minidev:json-smart:${versions.json_smart}"
60-
api('org.apache.calcite:calcite-core:1.38.0') {
60+
api('org.apache.calcite:calcite-core:1.39.0') {
6161
exclude group: 'net.minidev', module: 'json-smart'
6262
}
63-
api 'org.apache.calcite:calcite-linq4j:1.38.0'
63+
api 'org.apache.calcite:calcite-linq4j:1.39.0'
6464
api project(':common')
6565
implementation "com.github.seancfoley:ipaddress:5.4.2"
6666

core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.opensearch.sql.expression.function.udf.datetime.WeekFunction;
4747
import org.opensearch.sql.expression.function.udf.datetime.WeekdayFunction;
4848
import org.opensearch.sql.expression.function.udf.datetime.YearweekFunction;
49-
import org.opensearch.sql.expression.function.udf.math.CRC32Function;
5049
import org.opensearch.sql.expression.function.udf.math.ConvFunction;
5150
import org.opensearch.sql.expression.function.udf.math.DivideFunction;
5251
import org.opensearch.sql.expression.function.udf.math.EulerFunction;
@@ -60,7 +59,6 @@ public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
6059
public static final SqlOperator E = new EulerFunction().toUDF("E");
6160
public static final SqlOperator CONV = new ConvFunction().toUDF("CONVERT");
6261
public static final SqlOperator MOD = new ModFunction().toUDF("MOD");
63-
public static final SqlOperator CRC32 = new CRC32Function().toUDF("CRC32");
6462
public static final SqlOperator DIVIDE = new DivideFunction().toUDF("DIVIDE");
6563

6664
// Datetime function

core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ void populate() {
166166
registerOperator(ADD, SqlStdOperatorTable.PLUS);
167167
registerOperator(SUBTRACT, SqlStdOperatorTable.MINUS);
168168
registerOperator(MULTIPLY, SqlStdOperatorTable.MULTIPLY);
169-
// registerOperator(DIVIDE, SqlStdOperatorTable.DIVIDE);
170169
registerOperator(ASCII, SqlStdOperatorTable.ASCII);
171170
registerOperator(LENGTH, SqlStdOperatorTable.CHAR_LENGTH);
172171
registerOperator(LOWER, SqlStdOperatorTable.LOWER);
@@ -213,6 +212,7 @@ void populate() {
213212
registerOperator(RIGHT, SqlLibraryOperators.RIGHT);
214213
registerOperator(LEFT, SqlLibraryOperators.LEFT);
215214
registerOperator(LOG2, SqlLibraryOperators.LOG2);
215+
registerOperator(CRC32, SqlLibraryOperators.CRC32);
216216
registerOperator(INTERNAL_REGEXP_EXTRACT, SqlLibraryOperators.REGEXP_EXTRACT);
217217
registerOperator(INTERNAL_REGEXP_REPLACE_2, SqlLibraryOperators.REGEXP_REPLACE_2);
218218

@@ -223,7 +223,6 @@ void populate() {
223223
registerOperator(MOD, PPLBuiltinOperators.MOD);
224224
registerOperator(MODULUS, PPLBuiltinOperators.MOD);
225225
registerOperator(MODULUSFUNCTION, PPLBuiltinOperators.MOD);
226-
registerOperator(CRC32, PPLBuiltinOperators.CRC32);
227226
registerOperator(DIVIDE, PPLBuiltinOperators.DIVIDE);
228227

229228
// Register PPL Datetime UDF operator

core/src/main/java/org/opensearch/sql/expression/function/udf/math/CRC32Function.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLMathFunctionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void testCrc32() {
123123
"LogicalProject(CRC32TEST=[CRC32('test':VARCHAR)])\n"
124124
+ " LogicalTableScan(table=[[scott, EMP]])\n";
125125
verifyLogical(root, expectedLogical);
126-
String expectedSparkSql = "SELECT `CRC32`('test') `CRC32TEST`\nFROM `scott`.`EMP`";
126+
String expectedSparkSql = "SELECT CRC32('test') `CRC32TEST`\nFROM `scott`.`EMP`";
127127
verifyPPLToSparkSQL(root, expectedSparkSql);
128128
}
129129

@@ -223,9 +223,9 @@ public void testMod() {
223223
@Test
224224
public void testPi() {
225225
RelNode root = getRelNode("source=EMP | eval PI = pi() | fields PI");
226-
String expectedLogical = "LogicalProject(PI=[PI])\n LogicalTableScan(table=[[scott, EMP]])\n";
226+
String expectedLogical = "LogicalProject(PI=[PI()])\n LogicalTableScan(table=[[scott, EMP]])\n";
227227
verifyLogical(root, expectedLogical);
228-
String expectedSparkSql = "SELECT PI `PI`\nFROM `scott`.`EMP`";
228+
String expectedSparkSql = "SELECT PI() `PI`\nFROM `scott`.`EMP`";
229229
verifyPPLToSparkSQL(root, expectedSparkSql);
230230
}
231231

0 commit comments

Comments
 (0)