From 462c5dc6e8b88982ac5299e09d6480a1e9078e76 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 11 Jul 2023 13:37:47 -0700 Subject: [PATCH] Rename AvroFileWriterFactory --- .../src/main/java/io/trino/plugin/hive/HiveModule.java | 4 ++-- ...eFileWriterFactory.java => AvroFileWriterFactory.java} | 4 ++-- .../java/io/trino/plugin/hive/TestHiveFileFormats.java | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/{AvroHiveFileWriterFactory.java => AvroFileWriterFactory.java} (98%) diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java index 6fdaaa4729a4..59cfe7403c11 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java @@ -25,7 +25,7 @@ import io.trino.hdfs.TrinoFileSystemCache; import io.trino.hdfs.TrinoFileSystemCacheStats; import io.trino.plugin.base.CatalogName; -import io.trino.plugin.hive.avro.AvroHiveFileWriterFactory; +import io.trino.plugin.hive.avro.AvroFileWriterFactory; import io.trino.plugin.hive.avro.AvroHivePageSourceFactory; import io.trino.plugin.hive.fs.CachingDirectoryLister; import io.trino.plugin.hive.fs.TransactionScopeCachingDirectoryListerFactory; @@ -161,7 +161,7 @@ public void configure(Binder binder) fileWriterFactoryBinder.addBinding().to(SimpleSequenceFileWriterFactory.class).in(Scopes.SINGLETON); fileWriterFactoryBinder.addBinding().to(OrcFileWriterFactory.class).in(Scopes.SINGLETON); fileWriterFactoryBinder.addBinding().to(RcFileFileWriterFactory.class).in(Scopes.SINGLETON); - fileWriterFactoryBinder.addBinding().to(AvroHiveFileWriterFactory.class).in(Scopes.SINGLETON); + fileWriterFactoryBinder.addBinding().to(AvroFileWriterFactory.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ParquetReaderConfig.class); configBinder(binder).bindConfig(ParquetWriterConfig.class); diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroHiveFileWriterFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroFileWriterFactory.java similarity index 98% rename from plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroHiveFileWriterFactory.java rename to plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroFileWriterFactory.java index b7a6347fc934..8b3d420862fe 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroHiveFileWriterFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/avro/AvroFileWriterFactory.java @@ -55,7 +55,7 @@ import static io.trino.plugin.hive.util.HiveUtil.getColumnTypes; import static java.util.Objects.requireNonNull; -public class AvroHiveFileWriterFactory +public class AvroFileWriterFactory implements HiveFileWriterFactory { private final TrinoFileSystemFactory fileSystemFactory; @@ -63,7 +63,7 @@ public class AvroHiveFileWriterFactory private final NodeVersion nodeVersion; @Inject - public AvroHiveFileWriterFactory( + public AvroFileWriterFactory( TrinoFileSystemFactory fileSystemFactory, TypeManager typeManager, NodeVersion nodeVersion) diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileFormats.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileFormats.java index cd1dc6f20123..0d32453ad86f 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileFormats.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileFormats.java @@ -24,7 +24,7 @@ import io.trino.hive.formats.compression.CompressionKind; import io.trino.orc.OrcReaderOptions; import io.trino.orc.OrcWriterOptions; -import io.trino.plugin.hive.avro.AvroHiveFileWriterFactory; +import io.trino.plugin.hive.avro.AvroFileWriterFactory; import io.trino.plugin.hive.avro.AvroHivePageSourceFactory; import io.trino.plugin.hive.line.CsvFileWriterFactory; import io.trino.plugin.hive.line.CsvPageSourceFactory; @@ -434,7 +434,7 @@ public void testAvro(int rowCount, long fileSizePadding) .withColumns(getTestColumnsSupportedByAvro()) .withRowsCount(rowCount) .withFileSizePadding(fileSizePadding) - .withFileWriterFactory(new AvroHiveFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) + .withFileWriterFactory(new AvroFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) .isReadableByPageSource(new AvroHivePageSourceFactory(FILE_SYSTEM_FACTORY, STATS)) .isReadableByRecordCursor(createGenericHiveRecordCursorProvider(HDFS_ENVIRONMENT)); } @@ -599,7 +599,7 @@ public void testTruncateVarcharColumn() assertThatFileFormat(AVRO) .withWriteColumns(ImmutableList.of(writeColumn)) .withReadColumns(ImmutableList.of(readColumn)) - .withFileWriterFactory(new AvroHiveFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) + .withFileWriterFactory(new AvroFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) .isReadableByRecordCursor(createGenericHiveRecordCursorProvider(HDFS_ENVIRONMENT)) .isReadableByPageSource(new AvroHivePageSourceFactory(FILE_SYSTEM_FACTORY, STATS)); @@ -638,7 +638,7 @@ public void testAvroProjectedColumns(int rowCount) .withWriteColumns(writeColumns) .withReadColumns(readColumns) .withRowsCount(rowCount) - .withFileWriterFactory(new AvroHiveFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) + .withFileWriterFactory(new AvroFileWriterFactory(FILE_SYSTEM_FACTORY, TESTING_TYPE_MANAGER, new NodeVersion("test_version"))) .isReadableByRecordCursorPageSource(createGenericHiveRecordCursorProvider(HDFS_ENVIRONMENT)) .isReadableByPageSource(new AvroHivePageSourceFactory(FILE_SYSTEM_FACTORY, STATS)); }