Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ jobs:
- { modules: plugin/trino-cassandra }
- { modules: plugin/trino-clickhouse }
- { modules: plugin/trino-delta-lake }
- { modules: plugin/trino-delta-lake, profile: test-failure-recovery }
- { modules: plugin/trino-hive }
- { modules: plugin/trino-hive, profile: test-parquet }
- { modules: plugin/trino-hive, profile: test-failure-recovery }
Expand Down
63 changes: 63 additions & 0 deletions plugin/trino-delta-lake/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@
</dependency>

<!-- for testing -->
<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
Expand Down Expand Up @@ -243,6 +255,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing-containers</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-testing-services</artifactId>
Expand Down Expand Up @@ -289,6 +307,18 @@
<artifactId>azure-storage-blob</artifactId>
<version>12.10.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- conflicts with newer version of netty coming from AWS S3 cli via trino-exchange -->
<groupId>io.netty</groupId>
<artifactId>netty-transport-classes-epoll</artifactId>
</exclusion>
<exclusion>
<!-- conflicts with newer version of netty coming from AWS S3 cli via trino-exchange -->
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -380,9 +410,22 @@
<exclude>**/TestDeltaLakeAdlsStorage.java</exclude>
<exclude>**/TestDeltaLakeAdlsConnectorSmokeTest.java</exclude>
<exclude>**/TestDeltaLakeGlueMetastore.java</exclude>
<exclude>**/TestDelta*FailureRecoveryTest.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<configuration>
<ignoredResourcePatterns>
<!-- com.amazonaws:aws-java-sdk-core and software.amazon.awssdk:sdk-core MIME type file duplicate-->
<ignoredResourcePattern>mime.types</ignoredResourcePattern>
<ignoredResourcePattern>about.html</ignoredResourcePattern>
</ignoredResourcePatterns>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -405,5 +448,25 @@
</plugins>
</build>
</profile>

<profile>
<id>test-failure-recovery</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Failure recovery tests spend most of the time waiting for a retry -->
<threadCount>4</threadCount>
<includes>
<include>**/TestDelta*FailureRecoveryTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
import io.trino.plugin.hive.HiveColumnHandle;
import io.trino.spi.connector.ColumnHandle;
import io.trino.spi.type.Type;
import org.openjdk.jol.info.ClassLayout;

import java.util.Objects;
import java.util.Optional;

import static io.airlift.slice.SizeOf.estimatedSizeOf;
import static io.trino.plugin.deltalake.DeltaHiveTypeTranslator.toHiveType;
import static io.trino.plugin.deltalake.DeltaLakeColumnType.SYNTHESIZED;
import static io.trino.spi.type.BigintType.BIGINT;
Expand All @@ -32,6 +34,8 @@
public class DeltaLakeColumnHandle
implements ColumnHandle
{
private static final int INSTANCE_SIZE = ClassLayout.parseClass(DeltaLakeColumnHandle.class).instanceSize();

public static final String ROW_ID_COLUMN_NAME = "$row_id";
public static final Type ROW_ID_COLUMN_TYPE = BIGINT;

Expand Down Expand Up @@ -92,6 +96,12 @@ public boolean equals(Object obj)
this.columnType == other.columnType;
}

public long getRetainedSizeInBytes()
{
// type is not accounted for as the instances are cached (by TypeRegistry) and shared
return INSTANCE_SIZE + estimatedSizeOf(name);
}

@Override
public int hashCode()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class DeltaLakeInsertTableHandle
private final MetadataEntry metadataEntry;
private final List<DeltaLakeColumnHandle> inputColumns;
private final long readVersion;
private final boolean retriesEnabled;

@JsonCreator
public DeltaLakeInsertTableHandle(
Expand All @@ -40,14 +41,16 @@ public DeltaLakeInsertTableHandle(
@JsonProperty("location") String location,
@JsonProperty("metadataEntry") MetadataEntry metadataEntry,
@JsonProperty("inputColumns") List<DeltaLakeColumnHandle> inputColumns,
@JsonProperty("readVersion") long readVersion)
@JsonProperty("readVersion") long readVersion,
@JsonProperty("retriesEnabled") boolean retriesEnabled)
{
this.schemaName = requireNonNull(schemaName, "schemaName is null");
this.tableName = requireNonNull(tableName, "tableName is null");
this.metadataEntry = requireNonNull(metadataEntry, "metadataEntry is null");
this.inputColumns = ImmutableList.copyOf(inputColumns);
this.location = requireNonNull(location, "location is null");
this.readVersion = readVersion;
this.retriesEnabled = retriesEnabled;
}

@JsonProperty
Expand Down Expand Up @@ -85,4 +88,10 @@ public long getReadVersion()
{
return readVersion;
}

@JsonProperty
public boolean isRetriesEnabled()
{
return retriesEnabled;
}
}
Loading