From 78f10ce20a0b5adc7b4eb196a03c9fc4139abc07 Mon Sep 17 00:00:00 2001 From: Raunaq Morarka Date: Wed, 28 Aug 2024 17:14:46 +0530 Subject: [PATCH] Fix testParquetCaseSensitivity due to writer validation --- .../test/java/io/trino/plugin/hive/TestHiveFileFormats.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 f7e1e2c9f5b87..1cd10a8cf425b 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 @@ -622,7 +622,9 @@ public void testParquetCaseSensitivity(int rowCount) assertThatFileFormat(PARQUET) .withWriteColumns(ImmutableList.of(writeColumnA, writeColumnB)) .withReadColumns(ImmutableList.of(readColumn)) - .withSession(PARQUET_SESSION_USE_NAME) + // Parquet writer validation will attempt to read back all written columns, while the reader is case-insensitive and does not support reading all columns for this case. + // Since this is not a valid scenario for Trino parquet writer, we disable parquet writer validation to avoid test failures + .withSession(getHiveSession(createParquetHiveConfig(true), new ParquetWriterConfig().setValidationPercentage(0))) .withRowsCount(rowCount) .withFileWriterFactory(fileSystemFactory -> new ParquetFileWriterFactory(fileSystemFactory, new NodeVersion("test-version"), TESTING_TYPE_MANAGER, new HiveConfig(), STATS)) .isReadableByPageSource(fileSystemFactory -> new ParquetPageSourceFactory(fileSystemFactory, STATS, new ParquetReaderConfig(), new HiveConfig()));