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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SparkDeltaLake(String bucketName)
hiveMinio = closer.register(new Hive3MinioDataLake(bucketName));
hiveMinio.start();

closer.register(new GenericContainer<>("ghcr.io/trinodb/testing/spark3-delta:" + getDockerImagesVersion()))
closer.register(new GenericContainer<>("ghcr.io/trinodb/testing/spark4-delta:" + getDockerImagesVersion()))
.withCopyFileToContainer(forClasspathResource("spark-defaults.conf"), "/spark/conf/spark-defaults.conf")
.withNetwork(hiveMinio.getNetwork())
.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ spark.hadoop.fs.s3a.endpoint=http://minio:4566
spark.hadoop.fs.s3a.path.style.access=true
spark.hadoop.fs.s3a.access.key=accesskey
spark.hadoop.fs.s3a.secret.key=secretkey
spark.hadoop.fs.s3a.threads.keepalivetime=6000
spark.hadoop.fs.s3a.aws.credentials.provider=org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider
spark.hadoop.fs.s3a.connection.establish.timeout=3000
spark.hadoop.fs.s3a.connection.timeout=200000
spark.hadoop.fs.s3a.multipart.purge.age=86400
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import io.airlift.http.client.HttpClient;
import io.airlift.http.client.Request;
import io.airlift.http.client.StatusResponseHandler;
import io.airlift.http.client.StringResponseHandler.StringResponse;
import io.airlift.http.client.jetty.JettyHttpClient;
import io.airlift.json.ObjectMapperProvider;
Expand All @@ -29,6 +30,7 @@
import java.io.UncheckedIOException;
import java.net.URI;

import static com.google.common.base.Preconditions.checkState;
import static io.airlift.http.client.StaticBodyGenerator.createStaticBodyGenerator;
import static io.airlift.http.client.StatusResponseHandler.createStatusResponseHandler;
import static io.airlift.http.client.StringResponseHandler.createStringResponseHandler;
Expand Down Expand Up @@ -61,6 +63,11 @@ public TestingPolarisCatalog(String warehouseLocation)
polarisCatalog.waitingFor(new LogMessageWaitStrategy().withRegEx(".*Apache Polaris Server.* started.*"));
polarisCatalog.withEnv("POLARIS_BOOTSTRAP_CREDENTIALS", "default-realm,root,s3cr3t");
polarisCatalog.withEnv("polaris.realm-context.realms", "default-realm");
polarisCatalog.withEnv("polaris.readiness.ignore-severe-issues", "true");
polarisCatalog.withEnv("polaris.features.\"SUPPORTED_CATALOG_STORAGE_TYPES\"", "[\"FILE\"]");
polarisCatalog.withEnv("polaris.features.\"ALLOW_INSECURE_STORAGE_TYPES\"", "true");
polarisCatalog.withEnv("polaris.features.\"DROP_WITH_PURGE_ENABLED\"", "true");

polarisCatalog.start();

token = getToken();
Expand Down Expand Up @@ -94,15 +101,17 @@ private void createCatalog()
"\"id\": 1," +
"\"type\": \"INTERNAL\"," +
"\"readOnly\": false, " +
"\"storageConfigInfo\": {\"storageType\": \"FILE\"}, \"properties\": {\"default-base-location\": \"file://" + warehouseLocation + "\"}" +
"\"storageConfigInfo\": {\"storageType\": \"FILE\", \"allowedLocations\":[\"" + warehouseLocation + "\"]}, " +
"\"properties\": {\"default-base-location\": \"file://" + warehouseLocation + "\"}" +
"}";
Request request = Request.Builder.preparePost()
.setUri(URI.create(restUri() + "/api/management/v1/catalogs"))
.setHeader("Authorization", "Bearer " + token)
.setHeader("Content-Type", "application/json")
.setBodyGenerator(createStaticBodyGenerator(body, UTF_8))
.build();
HTTP_CLIENT.execute(request, createStatusResponseHandler());
StatusResponseHandler.StatusResponse response = HTTP_CLIENT.execute(request, createStatusResponseHandler());
checkState(response.getStatusCode() == 201, "Failed to create polaris catalog, status code: %s", response.getStatusCode());
}

private void grantPrivilege()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<dep.cassandra.version>4.17.0</dep.cassandra.version>
<dep.confluent.version>7.8.0</dep.confluent.version>
<dep.checkstyle.version>10.23.1</dep.checkstyle.version>
<dep.docker.images.version>113</dep.docker.images.version>
<dep.docker.images.version>116</dep.docker.images.version>
<dep.drift.version>1.23</dep.drift.version>
<dep.flyway.version>11.9.1</dep.flyway.version>
<dep.frontend-maven-plugin.version>1.15.1</dep.frontend-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void extendEnvironment(Environment.Builder builder)
@SuppressWarnings("resource")
private DockerContainer createSparkContainer()
{
DockerContainer container = new DockerContainer("ghcr.io/trinodb/testing/spark3-delta:" + hadoopImagesVersion, SPARK_CONTAINER_NAME)
DockerContainer container = new DockerContainer("ghcr.io/trinodb/testing/spark4-delta:" + hadoopImagesVersion, SPARK_CONTAINER_NAME)
.withCopyFileToContainer(forHostPath(configDir.getPath("spark-defaults.conf")), "/spark/conf/spark-defaults.conf")
.withCopyFileToContainer(forHostPath(dockerFiles.getDockerFilesHostPath("common/spark/log4j2.properties")), "/spark/conf/log4j2.properties")
.withStartupCheckStrategy(new IsRunningStartupCheckStrategy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ spark.hadoop.fs.s3a.endpoint=http://minio:9080
spark.hadoop.fs.s3a.path.style.access=true
spark.hadoop.fs.s3a.access.key=minio-access-key
spark.hadoop.fs.s3a.secret.key=minio-secret-key
spark.hadoop.fs.s3a.threads.keepalivetime=6000
spark.hadoop.fs.s3a.aws.credentials.provider=org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider
spark.hadoop.fs.s3a.connection.establish.timeout=3000
spark.hadoop.fs.s3a.connection.timeout=200000
spark.hadoop.fs.s3a.multipart.purge.age=86400
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import static com.google.common.collect.Iterables.getOnlyElement;
import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertQueryFailure;
import static io.trino.testing.TestingNames.randomNameSuffix;
import static io.trino.tests.product.TestGroups.DELTA_LAKE_DATABRICKS;
import static io.trino.tests.product.TestGroups.DELTA_LAKE_EXCLUDE_113;
Expand Down Expand Up @@ -352,8 +351,10 @@ public void testTypeWideningInteger()
assertThat(onTrino().executeQuery("SELECT * FROM delta.default." + tableName))
.containsOnly(row(127, -128), row(32767, -32768), row(2147483647, null));

assertQueryFailure(() -> onDelta().executeQuery("ALTER TABLE default." + tableName + " CHANGE COLUMN a TYPE long"))
.hasMessageContaining("ALTER TABLE CHANGE COLUMN is not supported for changing column a from INT to BIGINT");
// integer -> long
// TODO: Add support for reading long type values after Delta column type evolution from integer to long
// Unsupported type widening is tested in TestDeltaLakeBasic.testTypeWideningSkippingUnsupportedColumns
onDelta().executeQuery("ALTER TABLE default." + tableName + " CHANGE COLUMN a TYPE long");
}
finally {
onDelta().executeQuery("DROP TABLE default." + tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ public void testTablePartitionsWithDeletionVectors()
"TBLPROPERTIES ('delta.enableDeletionVectors' = true)");

List<Row> expectedBeforeDelete = ImmutableList.of(
row("{\"a\":1,\"c\":\"varchar_1\"}", 3L, 1347L, "{\"b\":{\"min\":11,\"max\":19,\"null_count\":0}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 449L, "{\"b\":{\"min\":13,\"max\":13,\"null_count\":0}}"));
row("{\"a\":1,\"c\":\"varchar_1\"}", 3L, 1398L, "{\"b\":{\"min\":11,\"max\":19,\"null_count\":0}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 466L, "{\"b\":{\"min\":13,\"max\":13,\"null_count\":0}}"));

List<Row> expectedAfterFirstDelete = ImmutableList.of(
row("{\"a\":1,\"c\":\"varchar_1\"}", 2L, 898L, "{\"b\":{\"min\":11,\"max\":17,\"null_count\":0}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 449L, "{\"b\":{\"min\":13,\"max\":13,\"null_count\":0}}"));
row("{\"a\":1,\"c\":\"varchar_1\"}", 2L, 932L, "{\"b\":{\"min\":11,\"max\":17,\"null_count\":0}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 466L, "{\"b\":{\"min\":13,\"max\":13,\"null_count\":0}}"));

List<Row> expectedAfterSecondDelete = ImmutableList.of(
row("{\"a\":1,\"c\":\"varchar_1\"}", 2L, 898L, "{\"b\":{\"min\":11,\"max\":17,\"null_count\":0}}"));
row("{\"a\":1,\"c\":\"varchar_1\"}", 2L, 932L, "{\"b\":{\"min\":11,\"max\":17,\"null_count\":0}}"));

try {
onDelta().executeQuery("INSERT INTO default." + tableName + " VALUES (1, 11, 'varchar_1'), (1, 19, 'varchar_1'), (1, 17, 'varchar_1'), (1, 13, 'varchar_2')");
Expand Down Expand Up @@ -141,9 +141,9 @@ public void testTablePartitionsWithNoColumnStats()
"TBLPROPERTIES ('delta.dataSkippingNumIndexedCols' = 0)");

List<Row> expected = ImmutableList.of(
row("{\"a\":1,\"c\":\"varchar_1\"}", 3L, 1347L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 449L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"),
row("{\"a\":1,\"c\":\"varchar_3\"}", 1L, 413L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"));
row("{\"a\":1,\"c\":\"varchar_1\"}", 3L, 1398L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"),
row("{\"a\":1,\"c\":\"varchar_2\"}", 1L, 466L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"),
row("{\"a\":1,\"c\":\"varchar_3\"}", 1L, 429L, "{\"b\":{\"min\":null,\"max\":null,\"null_count\":null}}"));

try {
onDelta().executeQuery("INSERT INTO default." + tableName + " VALUES (1, 11, 'varchar_1'), (1, 19, 'varchar_1'), (1, 17, 'varchar_1'), (1, 13, 'varchar_2'), (1, NULL, 'varchar_3')");
Expand Down
Loading