This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 649689c69fd 19937 replace filterable with translatable 20230113
(#23551)
649689c69fd is described below
commit 649689c69fd472fe3aa5ac6eead07aeb27dd38a5
Author: boyjoy1127 <[email protected]>
AuthorDate: Sat Jan 14 13:13:19 2023 +0800
19937 replace filterable with translatable 20230113 (#23551)
* test: add integration test.
* refactor: remove useless scalar enumerator.
Co-authored-by: boyjoy1127 <[email protected]>
---
.../executor/FilterableTableScanExecutor.java | 3 +-
.../executor/TranslatableTableScanExecutor.java | 9 +--
.../row/EmptyRowScalarEnumerator.java | 44 ------------
.../sqlfederation/row/MemoryScalarEnumerator.java | 67 ------------------
.../row/SQLFederationRowScalarEnumerator.java | 79 ----------------------
.../optimizer/it/SQLOptimizeEngineIT.java | 58 ++++++++++++++++
.../resources/cases/federation-query-sql-cases.xml | 30 ++++++++
7 files changed, 92 insertions(+), 198 deletions(-)
diff --git
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/FilterableTableScanExecutor.java
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/FilterableTableScanExecutor.java
index 0db55aea2fc..624233e4cbb 100644
---
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/FilterableTableScanExecutor.java
+++
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/FilterableTableScanExecutor.java
@@ -77,7 +77,6 @@ import
org.apache.shardingsphere.sqlfederation.optimizer.executor.TableScanExecu
import
org.apache.shardingsphere.sqlfederation.optimizer.metadata.filter.FilterableSchema;
import
org.apache.shardingsphere.sqlfederation.optimizer.util.SQLFederationPlannerUtil;
import org.apache.shardingsphere.sqlfederation.row.EmptyRowEnumerator;
-import org.apache.shardingsphere.sqlfederation.row.EmptyRowScalarEnumerator;
import org.apache.shardingsphere.sqlfederation.row.MemoryEnumerator;
import org.apache.shardingsphere.sqlfederation.row.SQLFederationRowEnumerator;
import
org.apache.shardingsphere.sqlfederation.spi.SQLFederationExecutorContext;
@@ -124,7 +123,7 @@ public final class FilterableTableScanExecutor implements
TableScanExecutor {
@Override
public Enumerator<Object> enumerator() {
- return new EmptyRowScalarEnumerator();
+ return new EmptyRowEnumerator();
}
};
}
diff --git
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TranslatableTableScanExecutor.java
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TranslatableTableScanExecutor.java
index 243d40e3dcf..d3fcdffd22f 100644
---
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TranslatableTableScanExecutor.java
+++
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TranslatableTableScanExecutor.java
@@ -83,11 +83,8 @@ import
org.apache.shardingsphere.sqlfederation.optimizer.metadata.filter.Filtera
import
org.apache.shardingsphere.sqlfederation.optimizer.metadata.translatable.StringToRexNodeUtil;
import
org.apache.shardingsphere.sqlfederation.optimizer.util.SQLFederationPlannerUtil;
import org.apache.shardingsphere.sqlfederation.row.EmptyRowEnumerator;
-import org.apache.shardingsphere.sqlfederation.row.EmptyRowScalarEnumerator;
import org.apache.shardingsphere.sqlfederation.row.MemoryEnumerator;
-import org.apache.shardingsphere.sqlfederation.row.MemoryScalarEnumerator;
import org.apache.shardingsphere.sqlfederation.row.SQLFederationRowEnumerator;
-import
org.apache.shardingsphere.sqlfederation.row.SQLFederationRowScalarEnumerator;
import
org.apache.shardingsphere.sqlfederation.spi.SQLFederationExecutorContext;
import java.sql.Connection;
@@ -157,7 +154,7 @@ public final class TranslatableTableScanExecutor implements
TableScanExecutor {
@Override
public Enumerator<Object> enumerator() {
- return new EmptyRowScalarEnumerator();
+ return new EmptyRowEnumerator();
}
};
}
@@ -173,7 +170,7 @@ public final class TranslatableTableScanExecutor implements
TableScanExecutor {
@Override
public Enumerator<Object> enumerator() {
- return new MemoryScalarEnumerator(tableData.getRows());
+ return new MemoryEnumerator(tableData.getRows());
}
};
}
@@ -204,7 +201,7 @@ public final class TranslatableTableScanExecutor implements
TableScanExecutor {
@Override
public Enumerator<Object> enumerator() {
- return new SQLFederationRowScalarEnumerator(rows, statements);
+ return new SQLFederationRowEnumerator(rows, statements);
}
};
}
diff --git
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/EmptyRowScalarEnumerator.java
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/EmptyRowScalarEnumerator.java
deleted file mode 100644
index 575f5f16db1..00000000000
---
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/EmptyRowScalarEnumerator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.sqlfederation.row;
-
-import org.apache.calcite.linq4j.Enumerator;
-
-/**
- * Empty row scalar enumerator.
- */
-public final class EmptyRowScalarEnumerator implements Enumerator<Object> {
-
- @Override
- public Object current() {
- return new Object();
- }
-
- @Override
- public boolean moveNext() {
- return false;
- }
-
- @Override
- public void reset() {
- }
-
- @Override
- public void close() {
- }
-}
diff --git
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/MemoryScalarEnumerator.java
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/MemoryScalarEnumerator.java
deleted file mode 100644
index 36af799eada..00000000000
---
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/MemoryScalarEnumerator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.sqlfederation.row;
-
-import org.apache.calcite.linq4j.Enumerator;
-import org.apache.shardingsphere.infra.metadata.data.ShardingSphereRowData;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Memory scalar enumerator.
- */
-public final class MemoryScalarEnumerator implements Enumerator<Object> {
-
- private final Collection<ShardingSphereRowData> rows;
-
- private Iterator<ShardingSphereRowData> rowDataIterator;
-
- private Object current;
-
- public MemoryScalarEnumerator(final Collection<ShardingSphereRowData>
rows) {
- this.rows = rows;
- rowDataIterator = rows.iterator();
- }
-
- @Override
- public Object current() {
- return current;
- }
-
- @Override
- public boolean moveNext() {
- if (rowDataIterator.hasNext()) {
- current = rowDataIterator.next().getRows();
- return true;
- }
- current = null;
- rowDataIterator = rows.iterator();
- return false;
- }
-
- @Override
- public void reset() {
- }
-
- @Override
- public void close() {
- rowDataIterator = rows.iterator();
- current = null;
- }
-}
diff --git
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/SQLFederationRowScalarEnumerator.java
b/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/SQLFederationRowScalarEnumerator.java
deleted file mode 100644
index 93f0ecc4396..00000000000
---
a/kernel/sql-federation/executor/core/src/main/java/org/apache/shardingsphere/sqlfederation/row/SQLFederationRowScalarEnumerator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.sqlfederation.row;
-
-import org.apache.calcite.linq4j.Enumerator;
-import
org.apache.shardingsphere.infra.util.exception.external.sql.type.wrapper.SQLWrapperException;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * SQL federation row scalar enumerator.
- */
-public final class SQLFederationRowScalarEnumerator implements
Enumerator<Object> {
-
- private final Collection<Object> rows;
-
- private final Collection<Statement> statements;
-
- private Iterator<Object> iterator;
-
- private Object currentRow;
-
- public SQLFederationRowScalarEnumerator(final Collection<Object> rows,
final Collection<Statement> statements) {
- this.rows = rows;
- this.statements = statements;
- iterator = rows.iterator();
- }
-
- @Override
- public Object current() {
- return currentRow;
- }
-
- @Override
- public boolean moveNext() {
- if (iterator.hasNext()) {
- currentRow = iterator.next();
- return true;
- }
- currentRow = null;
- iterator = rows.iterator();
- return false;
- }
-
- @Override
- public void reset() {
- }
-
- @Override
- public void close() {
- try {
- for (Statement each : statements) {
- each.close();
- }
- currentRow = null;
- iterator = rows.iterator();
- } catch (final SQLException ex) {
- throw new SQLWrapperException(ex);
- }
- }
-}
diff --git
a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLOptimizeEngineIT.java
b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLOptimizeEngineIT.java
index 69a59e52412..c7c991f1d49 100644
---
a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLOptimizeEngineIT.java
+++
b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLOptimizeEngineIT.java
@@ -91,6 +91,8 @@ public final class SQLOptimizeEngineIT {
tables.put("t_merchant", createTMerchantMetaData());
tables.put("t_product", createTProductMetaData());
tables.put("t_product_detail", createTProductDetailMetaData());
+ tables.put("multi_types_first", createMultiTypesFirstTableMetaData());
+ tables.put("multi_types_second",
createMultiTypesSecondTableMetaData());
optimizeEngine = new SQLOptimizeEngine(createSqlToRelConverter(new
ShardingSphereSchema(tables, Collections.emptyMap())),
SQLFederationPlannerUtil.createHepPlanner());
}
@@ -184,6 +186,62 @@ public final class SQLOptimizeEngineIT {
Collections.emptyList(), Collections.emptyList());
}
+ private ShardingSphereTable createMultiTypesFirstTableMetaData() {
+ ShardingSphereColumn idColumn = new ShardingSphereColumn("id",
Types.INTEGER, true, false, false, true, false);
+ ShardingSphereColumn bitColumn = new
ShardingSphereColumn("bit_column", Types.BIT, false, false, false, true, false);
+ ShardingSphereColumn tinyIntColumn = new
ShardingSphereColumn("tiny_int_column", Types.TINYINT, false, false, false,
true, false);
+ ShardingSphereColumn smallIntColumn = new
ShardingSphereColumn("small_int_column", Types.SMALLINT, false, false, false,
true, false);
+ ShardingSphereColumn integerColumn = new
ShardingSphereColumn("integer_column", Types.INTEGER, false, false, false,
true, false);
+ ShardingSphereColumn bigIntColumn = new
ShardingSphereColumn("big_int_column", Types.BIGINT, false, false, false, true,
false);
+ ShardingSphereColumn floatColumn = new
ShardingSphereColumn("float_column", Types.FLOAT, false, false, false, true,
false);
+ ShardingSphereColumn realColumn = new
ShardingSphereColumn("real_column", Types.REAL, false, false, false, true,
false);
+ ShardingSphereColumn doubleColumn = new
ShardingSphereColumn("double_column", Types.DOUBLE, false, false, false, true,
false);
+ ShardingSphereColumn numericColumn = new
ShardingSphereColumn("numeric_column", Types.NUMERIC, false, false, false,
true, false);
+ ShardingSphereColumn decimalColumn = new
ShardingSphereColumn("decimal_column", Types.DECIMAL, false, false, false,
true, false);
+ ShardingSphereColumn charColumn = new
ShardingSphereColumn("char_column", Types.CHAR, false, false, false, true,
false);
+ ShardingSphereColumn varcharColumn = new
ShardingSphereColumn("varchar_column", Types.VARCHAR, false, false, false,
true, false);
+ ShardingSphereColumn longVarcharColumn = new
ShardingSphereColumn("long_varchar_column", Types.LONGVARCHAR, false, false,
false, true, false);
+ ShardingSphereColumn dateColumn = new
ShardingSphereColumn("date_column", Types.DATE, false, false, false, true,
false);
+ ShardingSphereColumn timeColumn = new
ShardingSphereColumn("time_column", Types.TIME, false, false, false, true,
false);
+ ShardingSphereColumn timeStampColumn = new
ShardingSphereColumn("time_stamp_column", Types.TIMESTAMP, false, false, false,
true, false);
+ ShardingSphereColumn binaryColumn = new
ShardingSphereColumn("binary_column", Types.BINARY, false, false, false, true,
false);
+ ShardingSphereColumn varBinaryColumn = new
ShardingSphereColumn("varbinary_column", Types.VARBINARY, false, false, false,
true, false);
+ ShardingSphereColumn longVarbinaryColumn = new
ShardingSphereColumn("long_varbinary_column", Types.LONGVARBINARY, false,
false, false, true, false);
+ ShardingSphereColumn nullColumn = new
ShardingSphereColumn("null_column", Types.NULL, false, false, false, true,
false);
+ ShardingSphereColumn otherColumn = new
ShardingSphereColumn("other_column", Types.OTHER, false, false, false, true,
false);
+ return new ShardingSphereTable("multi_types_first",
Arrays.asList(idColumn, bitColumn, tinyIntColumn, smallIntColumn,
integerColumn, bigIntColumn, floatColumn,
+ realColumn, doubleColumn, numericColumn, decimalColumn,
charColumn, varcharColumn, longVarcharColumn, dateColumn, timeColumn,
timeStampColumn, binaryColumn,
+ varBinaryColumn, longVarbinaryColumn, nullColumn, otherColumn),
+ Collections.emptyList(), Collections.emptyList());
+ }
+
+ private ShardingSphereTable createMultiTypesSecondTableMetaData() {
+ ShardingSphereColumn idColumn = new ShardingSphereColumn("id",
Types.INTEGER, true, false, false, true, false);
+ ShardingSphereColumn bitColumn = new
ShardingSphereColumn("bit_column", Types.BIT, false, false, false, true, false);
+ ShardingSphereColumn tinyIntColumn = new
ShardingSphereColumn("tiny_int_column", Types.TINYINT, false, false, false,
true, false);
+ ShardingSphereColumn smallIntColumn = new
ShardingSphereColumn("small_int_column", Types.SMALLINT, false, false, false,
true, false);
+ ShardingSphereColumn integerColumn = new
ShardingSphereColumn("integer_column", Types.INTEGER, false, false, false,
true, false);
+ ShardingSphereColumn bigIntColumn = new
ShardingSphereColumn("big_int_column", Types.BIGINT, false, false, false, true,
false);
+ ShardingSphereColumn floatColumn = new
ShardingSphereColumn("float_column", Types.FLOAT, false, false, false, true,
false);
+ ShardingSphereColumn realColumn = new
ShardingSphereColumn("real_column", Types.REAL, false, false, false, true,
false);
+ ShardingSphereColumn doubleColumn = new
ShardingSphereColumn("double_column", Types.DOUBLE, false, false, false, true,
false);
+ ShardingSphereColumn numericColumn = new
ShardingSphereColumn("numeric_column", Types.NUMERIC, false, false, false,
true, false);
+ ShardingSphereColumn decimalColumn = new
ShardingSphereColumn("decimal_column", Types.DECIMAL, false, false, false,
true, false);
+ ShardingSphereColumn charColumn = new
ShardingSphereColumn("char_column", Types.CHAR, false, false, false, true,
false);
+ ShardingSphereColumn varcharColumn = new
ShardingSphereColumn("varchar_column", Types.VARCHAR, false, false, false,
true, false);
+ ShardingSphereColumn longVarcharColumn = new
ShardingSphereColumn("long_varchar_column", Types.LONGVARCHAR, false, false,
false, true, false);
+ ShardingSphereColumn dateColumn = new
ShardingSphereColumn("date_column", Types.DATE, false, false, false, true,
false);
+ ShardingSphereColumn timeColumn = new
ShardingSphereColumn("time_column", Types.TIME, false, false, false, true,
false);
+ ShardingSphereColumn timeStampColumn = new
ShardingSphereColumn("time_stamp_column", Types.TIMESTAMP, false, false, false,
true, false);
+ ShardingSphereColumn binaryColumn = new
ShardingSphereColumn("binary_column", Types.BINARY, false, false, false, true,
false);
+ ShardingSphereColumn varBinaryColumn = new
ShardingSphereColumn("varbinary_column", Types.VARBINARY, false, false, false,
true, false);
+ ShardingSphereColumn longVarbinaryColumn = new
ShardingSphereColumn("long_varbinary_column", Types.LONGVARBINARY, false,
false, false, true, false);
+ return new ShardingSphereTable("multi_types_second",
Arrays.asList(idColumn, bitColumn, tinyIntColumn, smallIntColumn,
integerColumn, bigIntColumn, floatColumn,
+ realColumn, doubleColumn, numericColumn, decimalColumn,
charColumn, varcharColumn, longVarcharColumn, dateColumn, timeColumn,
timeStampColumn, binaryColumn,
+ varBinaryColumn, longVarbinaryColumn),
+ Collections.emptyList(), Collections.emptyList());
+ }
+
private SqlToRelConverter createSqlToRelConverter(final
ShardingSphereSchema schema) {
CalciteConnectionConfig connectionConfig = new
CalciteConnectionConfigImpl(new Properties());
RelDataTypeFactory relDataTypeFactory = new JavaTypeFactoryImpl();
diff --git
a/kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml
b/kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml
index b8de1975fb5..e0050bc429e 100644
---
a/kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml
+++
b/kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml
@@ -408,4 +408,34 @@
<test-case sql="SELECT * FROM t_order UNION ALL SELECT * FROM t_order
ORDER BY order_id LIMIT 5, 5">
<assertion expected-result="EnumerableLimit(offset=[5], fetch=[5])
EnumerableMergeUnion(all=[true]) EnumerableLimit(fetch=[10])
EnumerableSort(sort0=[$0], dir0=[ASC])
TranslatableTableScan(table=[[federate_jdbc, t_order]], fields=[[0, 1, 2, 3, 4,
5]]) EnumerableLimit(fetch=[10]) EnumerableSort(sort0=[$0], dir0=[ASC])
TranslatableTableScan(table=[[federate_jdbc, t_order]], fields=[[0, 1,
2, 3, 4, 5]])" />
</test-case>
+
+
+ <!-- ONLY String and Integer are supported by federation query -->
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.tiny_int_column
= 1">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($2):INTEGER, 1){2=-6}, null, null,
null, null, null, null, null, null, nu [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.small_int_column
= 1">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($3):INTEGER, 1){3=5}, null, null,
null, null, null, null, null, null, nul [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.integer_column =
1">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($4):INTEGER, 1){4=4}, null, null,
null, null, null, null, null, null, nul [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.big_int_column =
1">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($5):BIGINT, 1){5=-5}, null, null,
null, null, null, null, null, null, nul [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.char_column =
'1'">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($11):VARCHAR, '1'){11=1}, null,
null, null, null, null, null, null, null, [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE second.varchar_column =
'1'">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($12):VARCHAR, '1'){12=12}, null,
null, null, null, null, null, null, null [...]
+ </test-case>
+
+ <test-case sql="SELECT * FROM multi_types_first first JOIN
multi_types_second second ON first.id = second.id WHERE
second.long_varchar_column = '1'">
+ <assertion expected-result="EnumerableHashJoin(condition=[=($0, $22)],
joinType=[inner]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_first]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21]]) TranslatableTableScan(table=[[federate_jdbc,
multi_types_second]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19]], filters=[[=(CAST($13):VARCHAR, '1'){13=-1}, null,
null, null, null, null, null, null, null [...]
+ </test-case>
</test-cases>