diff --git a/azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSOutputFile.java b/azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSOutputFile.java index 3fa21d6a3e79..2e784cac805c 100644 --- a/azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSOutputFile.java +++ b/azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSOutputFile.java @@ -28,7 +28,6 @@ import com.azure.storage.file.datalake.options.FileParallelUploadOptions; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.io.UncheckedIOException; import java.util.function.Supplier; import org.apache.iceberg.azure.AzureProperties; @@ -98,19 +97,7 @@ public CAS prepare(Supplier source) { final byte[] buffer = new byte[8192]; try (InputStream in = source.get(); FileChecksumOutputStream chk = - new FileChecksumOutputStream( - new OutputStream() { - @Override - public void write(int b) { - // TODO: no NullOutputStream? - } - - @Override - public void write(byte[] b, int off, int len) { - // do nothing - } - }, - checksum)) { + new FileChecksumOutputStream(ByteStreams.nullOutputStream(), checksum)) { ByteStreams.copy(in, chk); } catch (IOException e) { throw new UncheckedIOException(e); diff --git a/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSCatalogTest.java b/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSCatalogTest.java index 000e249ba59f..c6223d5597b6 100644 --- a/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSCatalogTest.java +++ b/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSCatalogTest.java @@ -64,7 +64,7 @@ public static void initStorage() { uniqTestRun = UUID.randomUUID().toString(); LOG.info("TEST RUN: {}", uniqTestRun); AzureSAS creds = - AzureSAS.readCreds(new File("/IdeaProjects/.cloud/azure/lstnsgym-20250228.json")); + AzureSAS.readCreds(new File("/home/chris/work/.cloud/azure/lstnsgym-20250228.json")); if (creds != null) { azureProperties = Maps.newHashMap(); azureProperties.put( diff --git a/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSFileIOCatalogTransactionTests.java b/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSFileIOCatalogTransactionTests.java index c51d29d0613b..ab1790c573ef 100644 --- a/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSFileIOCatalogTransactionTests.java +++ b/azure/src/test/java/org/apache/iceberg/azure/adlsv2/ADLSFileIOCatalogTransactionTests.java @@ -61,7 +61,7 @@ public static void initStorage() throws IOException { uniqTestRun = UUID.randomUUID().toString(); LOG.info("TEST RUN: {}", uniqTestRun); AzureSAS creds = - AzureSAS.readCreds(new File("/IdeaProjects/.cloud/azure/lstnsgym-20250228.json")); + AzureSAS.readCreds(new File("/home/chris/work/.cloud/azure/lstnsgym-20250228.json")); if (creds != null) { azureProperties = Maps.newHashMap(); azureProperties.put( diff --git a/gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSOutputFile.java b/gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSOutputFile.java index 2f3853922622..43d3e17cbda5 100644 --- a/gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSOutputFile.java +++ b/gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSOutputFile.java @@ -22,7 +22,6 @@ import com.google.cloud.storage.Storage; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.io.UncheckedIOException; import java.util.function.Supplier; import org.apache.iceberg.exceptions.AlreadyExistsException; @@ -89,19 +88,7 @@ public CAS prepare(Supplier source) { final byte[] buffer = new byte[8192]; try (InputStream in = source.get(); FileChecksumOutputStream chk = - new FileChecksumOutputStream( - new OutputStream() { - @Override - public void write(int b) { - // TODO: no NullOutputStream? - } - - @Override - public void write(byte[] b, int off, int len) { - // do nothing - } - }, - checksum)) { + new FileChecksumOutputStream(ByteStreams.nullOutputStream(), checksum)) { ByteStreams.copy(in, chk); } catch (IOException e) { throw new UncheckedIOException(e);