Skip to content

Commit

Permalink
Use shaded version of Coral
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Jul 28, 2023
1 parent 46cad1c commit 7c6cc06
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 139 deletions.
26 changes: 5 additions & 21 deletions plugin/trino-hive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,6 @@
<artifactId>guice</artifactId>
</dependency>

<dependency>
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
<classifier>shaded</classifier>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-common</artifactId>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-hive</artifactId>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-trino</artifactId>
</dependency>

<dependency>
<groupId>dev.failsafe</groupId>
<artifactId>failsafe</artifactId>
Expand Down Expand Up @@ -202,6 +181,11 @@
<artifactId>trino-plugin-toolkit</artifactId>
</dependency>

<dependency>
<groupId>io.trino.coral</groupId>
<artifactId>coral</artifactId>
</dependency>

<dependency>
<groupId>io.trino.hadoop</groupId>
<artifactId>hadoop-apache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public List<String> getAllDatabases()

// returning null for missing entry is as per Coral's requirements
@Override
public org.apache.hadoop.hive.metastore.api.Database getDatabase(String dbName)
public com.linkedin.coral.hive.metastore.api.Database getDatabase(String dbName)
{
return delegate.getDatabase(dbName)
.map(database -> toHiveDatabase(toMetastoreApiDatabase(database)))
Expand All @@ -71,7 +71,7 @@ public List<String> getAllTables(String dbName)
}

@Override
public org.apache.hadoop.hive.metastore.api.Table getTable(String dbName, String tableName)
public com.linkedin.coral.hive.metastore.api.Table getTable(String dbName, String tableName)
{
if (!dbName.isEmpty() && !tableName.isEmpty()) {
Optional<Table> redirected = tableRedirection.redirect(new SchemaTableName(dbName, tableName));
Expand All @@ -85,19 +85,19 @@ public org.apache.hadoop.hive.metastore.api.Table getTable(String dbName, String
.orElse(null);
}

private static org.apache.hadoop.hive.metastore.api.Database toHiveDatabase(Database database)
private static com.linkedin.coral.hive.metastore.api.Database toHiveDatabase(Database database)
{
var result = new org.apache.hadoop.hive.metastore.api.Database();
var result = new com.linkedin.coral.hive.metastore.api.Database();
result.setName(database.getName());
result.setDescription(database.getDescription());
result.setLocationUri(database.getLocationUri());
result.setParameters(database.getParameters());
return result;
}

private static org.apache.hadoop.hive.metastore.api.Table toHiveTable(Table table)
private static com.linkedin.coral.hive.metastore.api.Table toHiveTable(Table table)
{
var result = new org.apache.hadoop.hive.metastore.api.Table();
var result = new com.linkedin.coral.hive.metastore.api.Table();
result.setDbName(table.getDbName());
result.setTableName(table.getTableName());
result.setTableType(table.getTableType());
Expand All @@ -111,9 +111,9 @@ private static org.apache.hadoop.hive.metastore.api.Table toHiveTable(Table tabl
return result;
}

private static org.apache.hadoop.hive.metastore.api.StorageDescriptor toHiveStorageDescriptor(StorageDescriptor storage)
private static com.linkedin.coral.hive.metastore.api.StorageDescriptor toHiveStorageDescriptor(StorageDescriptor storage)
{
var result = new org.apache.hadoop.hive.metastore.api.StorageDescriptor();
var result = new com.linkedin.coral.hive.metastore.api.StorageDescriptor();
result.setCols(storage.getCols().stream()
.map(CoralSemiTransactionalHiveMSCAdapter::toHiveFieldSchema)
.toList());
Expand All @@ -127,9 +127,9 @@ private static org.apache.hadoop.hive.metastore.api.StorageDescriptor toHiveStor
return result;
}

private static org.apache.hadoop.hive.metastore.api.SerDeInfo toHiveSerdeInfo(SerDeInfo info)
private static com.linkedin.coral.hive.metastore.api.SerDeInfo toHiveSerdeInfo(SerDeInfo info)
{
var result = new org.apache.hadoop.hive.metastore.api.SerDeInfo();
var result = new com.linkedin.coral.hive.metastore.api.SerDeInfo();
result.setName(info.getName());
result.setDescription(info.getDescription());
result.setSerializationLib(info.getSerializationLib());
Expand All @@ -139,9 +139,9 @@ private static org.apache.hadoop.hive.metastore.api.SerDeInfo toHiveSerdeInfo(Se
return result;
}

private static org.apache.hadoop.hive.metastore.api.FieldSchema toHiveFieldSchema(FieldSchema field)
private static com.linkedin.coral.hive.metastore.api.FieldSchema toHiveFieldSchema(FieldSchema field)
{
var result = new org.apache.hadoop.hive.metastore.api.FieldSchema();
var result = new com.linkedin.coral.hive.metastore.api.FieldSchema();
result.setName(field.getName());
result.setType(field.getType());
result.setComment(field.getComment());
Expand Down
11 changes: 0 additions & 11 deletions plugin/trino-iceberg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@
<groupId>io.trino</groupId>
<artifactId>trino-hive</artifactId>
<exclusions>
<exclusion>
<!-- calcite-core and Iceberg have conflicting versions of org.apache.commons:commons-lang3 -->
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
</exclusion>
<exclusion>
<groupId>io.airlift</groupId>
<artifactId>http-client</artifactId>
Expand Down Expand Up @@ -437,12 +432,6 @@
<artifactId>trino-hive</artifactId>
<type>test-jar</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
66 changes: 6 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
<dep.errorprone.version>2.20.0</dep.errorprone.version>
<dep.testcontainers.version>1.18.3</dep.testcontainers.version>
<dep.duct-tape.version>1.0.8</dep.duct-tape.version>
<dep.coral.version>2.0.153</dep.coral.version>
<dep.confluent.version>7.3.1</dep.confluent.version>
<dep.kafka-clients.version>3.3.2</dep.kafka-clients.version>
<dep.casandra.version>4.14.0</dep.casandra.version>
Expand Down Expand Up @@ -511,65 +510,6 @@
<version>2.2.220</version>
</dependency>

<dependency>
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.21.0.259</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
<!-- Exclude everything because shaded version of calcite-core still pulls in all the original dependencies -->
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-common</artifactId>
<version>${dep.coral.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hive</groupId>
<artifactId>hive-metastore</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-hive</artifactId>
<version>${dep.coral.version}</version>
</dependency>

<dependency>
<groupId>com.linkedin.coral</groupId>
<artifactId>coral-trino</artifactId>
<version>${dep.coral.version}</version>
<exclusions>
<!--
The `trino-parser` library is being used internally within the `coral-trino` library for
parsing Trino SQL statements. This functionality is irrelevant in the context of
using Coral for Hive view translations within Trino.
This dependency is excluded because `trino-parser` does not guarantee API or behavioral
backwards compatibility.
Trino cannot provide the version on which `coral-trino` library depends on, because the
current version of `trino-parser` is used in tests of this module.
The dependency is therefore intentionally excluded to avoid breaking in an unexpected way,
or silent correctness issues.
-->
<exclusion>
<groupId>io.trino</groupId>
<artifactId>trino-parser</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down Expand Up @@ -1423,6 +1363,12 @@
<version>0.25</version>
</dependency>

<dependency>
<groupId>io.trino.coral</groupId>
<artifactId>coral</artifactId>
<version>2.0.153-1</version>
</dependency>

<dependency>
<groupId>io.trino.hadoop</groupId>
<artifactId>hadoop-apache</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions testing/trino-faulttolerant-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,27 +196,13 @@
<groupId>io.trino</groupId>
<artifactId>trino-iceberg</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- calcite-core and iceberg-data have conflicting versions of org.apache.commons:commons-lang3 -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-iceberg</artifactId>
<type>test-jar</type>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- calcite-core and iceberg-data have conflicting versions of org.apache.commons:commons-lang3 -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
7 changes: 0 additions & 7 deletions testing/trino-product-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,6 @@
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
<classifier>shaded</classifier>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions testing/trino-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,13 @@
<groupId>io.trino</groupId>
<artifactId>trino-hive</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- calcite-core and Iceberg have conflicting versions of org.apache.commons:commons-lang3 -->
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-hive</artifactId>
<type>test-jar</type>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- calcite-core and Iceberg have conflicting versions of org.apache.commons:commons-lang3 -->
<groupId>com.linkedin.calcite</groupId>
<artifactId>calcite-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down

0 comments on commit 7c6cc06

Please sign in to comment.