Skip to content

Commit 077acbe

Browse files
committed
Add support for JOIN PUSHDOWN in Exasol connector
1 parent de0e308 commit 077acbe

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

docs/src/main/sphinx/connector/exasol.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,16 @@ FROM
206206

207207
```{include} query-table-function-ordering.fragment
208208
```
209+
210+
(exasol-pushdown)=
211+
### Pushdown
212+
213+
The connector supports pushdown for the following operations:
214+
215+
- {ref}`join-pushdown`
216+
217+
```{include} pushdown-correctness-behavior.fragment
218+
```
219+
220+
```{include} join-pushdown-enabled-true.fragment
221+
```

plugin/trino-exasol/src/main/java/io/trino/plugin/exasol/ExasolClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ protected void renameTable(ConnectorSession session, Connection connection, Stri
245245
@Override
246246
protected boolean isSupportedJoinCondition(ConnectorSession session, JdbcJoinCondition joinCondition)
247247
{
248-
// Deactivated because test 'testJoinPushdown()' requires write access which is not implemented for Exasol
249-
return false;
248+
return true;
250249
}
251250

252251
@Override

plugin/trino-exasol/src/test/java/io/trino/plugin/exasol/TestExasolConnectorTest.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.trino.testing.sql.SqlExecutor;
2424
import io.trino.testing.sql.TestTable;
2525
import io.trino.testing.sql.TestView;
26+
import org.intellij.lang.annotations.Language;
2627
import org.junit.jupiter.api.Test;
2728
import org.junit.jupiter.api.parallel.Isolated;
2829

@@ -59,9 +60,9 @@ protected QueryRunner createQueryRunner()
5960
protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
6061
{
6162
return switch (connectorBehavior) {
63+
case SUPPORTS_JOIN_PUSHDOWN -> true;
6264
// Tests requires write access which is not implemented
6365
case SUPPORTS_AGGREGATION_PUSHDOWN,
64-
SUPPORTS_JOIN_PUSHDOWN,
6566
SUPPORTS_LIMIT_PUSHDOWN,
6667
SUPPORTS_TOPN_PUSHDOWN -> false;
6768

@@ -126,6 +127,20 @@ protected TestTable createTableWithUnsupportedColumn()
126127
"(one NUMBER(19), two GEOMETRY, three VARCHAR(10 CHAR))");
127128
}
128129

130+
@Override
131+
// Override, because read-only Exasol connector does not support CREATE TABLE and INSERT statements
132+
protected TestTable newTrinoTable(String namePrefix, @Language("SQL") String tableDefinition, List<String> rowsToInsert)
133+
{
134+
return new TestTable(exasolServer.getSqlExecutor(), TEST_SCHEMA + "." + namePrefix,
135+
normalizeTableDefinition(tableDefinition), rowsToInsert);
136+
}
137+
138+
// Normalize to add test schema prefix to the name of the nation table
139+
private String normalizeTableDefinition(String original)
140+
{
141+
return original.replaceAll("FROM nation", "FROM %s.nation".formatted(TEST_SCHEMA));
142+
}
143+
129144
@Test
130145
@Override
131146
public void testShowColumns()

0 commit comments

Comments
 (0)