From 92f04cf75695803e77cdd260d46d62f2fe3fa0a0 Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Fri, 22 Mar 2024 17:06:52 +0100 Subject: [PATCH] Update tpch to 1.4 --- .../io/trino/execution/buffer/TestPagesSerde.java | 6 +++--- .../BenchmarkDynamicFilterSourceOperator.java | 2 +- .../operator/BenchmarkGroupedTopNRankBuilder.java | 8 ++++---- .../BenchmarkGroupedTopNRowNumberBuilder.java | 8 ++++---- .../io/trino/operator/BenchmarkTopNOperator.java | 8 ++++---- .../spiller/BenchmarkBinaryFileSpiller.java | 10 +++++----- .../io/trino/sql/gen/BenchmarkPageProcessor.java | 6 +++--- .../io/trino/plugin/hive/TestHivePageSink.java | 4 ++-- .../plugin/hive/orc/TestOrcPageSourceFactory.java | 14 +++++++------- .../trino/plugin/tpch/TpchRecordSetProvider.java | 2 +- pom.xml | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/core/trino-main/src/test/java/io/trino/execution/buffer/TestPagesSerde.java b/core/trino-main/src/test/java/io/trino/execution/buffer/TestPagesSerde.java index 51d2259e23b7..42628fb62443 100644 --- a/core/trino-main/src/test/java/io/trino/execution/buffer/TestPagesSerde.java +++ b/core/trino-main/src/test/java/io/trino/execution/buffer/TestPagesSerde.java @@ -165,13 +165,13 @@ private static Page generatePage(List types, int rowCount, Iterator createInputPages(int positionsPerPage) pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - BIGINT.writeLong(pageBuilder.getBlockBuilder(0), lineItem.getOrderKey()); + BIGINT.writeLong(pageBuilder.getBlockBuilder(0), lineItem.orderKey()); if (pageBuilder.getPositionCount() == positionsPerPage) { pages.add(pageBuilder.build()); diff --git a/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRankBuilder.java b/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRankBuilder.java index bb586cc7c7f7..7bdbe32a2763 100644 --- a/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRankBuilder.java +++ b/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRankBuilder.java @@ -155,10 +155,10 @@ private static Page createInputPage(int positions, List types) pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.getExtendedPrice()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.getDiscount()); - VARCHAR.writeString(pageBuilder.getBlockBuilder(STATUS), lineItem.getStatus()); - BIGINT.writeLong(pageBuilder.getBlockBuilder(QUANTITY), lineItem.getQuantity()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.extendedPrice()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.discount()); + VARCHAR.writeString(pageBuilder.getBlockBuilder(STATUS), lineItem.status()); + BIGINT.writeLong(pageBuilder.getBlockBuilder(QUANTITY), lineItem.quantity()); } return pageBuilder.build(); } diff --git a/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRowNumberBuilder.java b/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRowNumberBuilder.java index 9db292171a51..184437cdcb97 100644 --- a/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRowNumberBuilder.java +++ b/core/trino-main/src/test/java/io/trino/operator/BenchmarkGroupedTopNRowNumberBuilder.java @@ -145,10 +145,10 @@ private static Page createInputPage(int positions, List types) pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.getExtendedPrice()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.getDiscount()); - DATE.writeLong(pageBuilder.getBlockBuilder(SHIP_DATE), lineItem.getShipDate()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.getQuantity()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.extendedPrice()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.discount()); + DATE.writeLong(pageBuilder.getBlockBuilder(SHIP_DATE), lineItem.shipDate()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.quantity()); } return pageBuilder.build(); } diff --git a/core/trino-main/src/test/java/io/trino/operator/BenchmarkTopNOperator.java b/core/trino-main/src/test/java/io/trino/operator/BenchmarkTopNOperator.java index 01a8b443edf5..57ce25670a5d 100644 --- a/core/trino-main/src/test/java/io/trino/operator/BenchmarkTopNOperator.java +++ b/core/trino-main/src/test/java/io/trino/operator/BenchmarkTopNOperator.java @@ -131,10 +131,10 @@ private static List createInputPages(int positionsPerPage, List type pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.getExtendedPrice()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.getDiscount()); - DATE.writeLong(pageBuilder.getBlockBuilder(SHIP_DATE), lineItem.getShipDate()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.getQuantity()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.extendedPrice()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.discount()); + DATE.writeLong(pageBuilder.getBlockBuilder(SHIP_DATE), lineItem.shipDate()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.quantity()); if (pageBuilder.getPositionCount() == positionsPerPage) { pages.add(pageBuilder.build()); diff --git a/core/trino-main/src/test/java/io/trino/operator/spiller/BenchmarkBinaryFileSpiller.java b/core/trino-main/src/test/java/io/trino/operator/spiller/BenchmarkBinaryFileSpiller.java index 758647453f31..466203fc1ee4 100644 --- a/core/trino-main/src/test/java/io/trino/operator/spiller/BenchmarkBinaryFileSpiller.java +++ b/core/trino-main/src/test/java/io/trino/operator/spiller/BenchmarkBinaryFileSpiller.java @@ -145,11 +145,11 @@ private List createInputPages() pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - BIGINT.writeLong(pageBuilder.getBlockBuilder(0), lineItem.getOrderKey()); - BIGINT.writeLong(pageBuilder.getBlockBuilder(1), lineItem.getDiscountPercent()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(2), lineItem.getDiscount()); - VARCHAR.writeString(pageBuilder.getBlockBuilder(3), lineItem.getReturnFlag()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(4), lineItem.getExtendedPrice()); + BIGINT.writeLong(pageBuilder.getBlockBuilder(0), lineItem.orderKey()); + BIGINT.writeLong(pageBuilder.getBlockBuilder(1), lineItem.discountPercent()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(2), lineItem.discount()); + VARCHAR.writeString(pageBuilder.getBlockBuilder(3), lineItem.returnFlag()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(4), lineItem.extendedPrice()); } pages.add(pageBuilder.build()); pageBuilder.reset(); diff --git a/core/trino-main/src/test/java/io/trino/sql/gen/BenchmarkPageProcessor.java b/core/trino-main/src/test/java/io/trino/sql/gen/BenchmarkPageProcessor.java index 33c19e8f7b48..7c179c9d672a 100644 --- a/core/trino-main/src/test/java/io/trino/sql/gen/BenchmarkPageProcessor.java +++ b/core/trino-main/src/test/java/io/trino/sql/gen/BenchmarkPageProcessor.java @@ -126,10 +126,10 @@ private static Page createInputPage() pageBuilder.declarePosition(); LineItem lineItem = iterator.next(); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.getExtendedPrice()); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.getDiscount()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(EXTENDED_PRICE), lineItem.extendedPrice()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(DISCOUNT), lineItem.discount()); VARCHAR.writeSlice(pageBuilder.getBlockBuilder(SHIP_DATE), Slices.wrappedBuffer(LineItemColumn.SHIP_DATE.getString(lineItem).getBytes(UTF_8))); - DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.getQuantity()); + DOUBLE.writeDouble(pageBuilder.getBlockBuilder(QUANTITY), lineItem.quantity()); } return pageBuilder.build(); } diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSink.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSink.java index dbdac8393f05..f15258060b44 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSink.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHivePageSink.java @@ -181,8 +181,8 @@ private void testCloseIdleWriters(DataSize idleWritersMinFileSize, int expectedT List columnHandles = getPartitionedColumnHandles(SHIP_MODE.getColumnName()); Location location = makeFileName(config); ConnectorPageSink pageSink = createPageSink(fileSystemFactory, transaction, config, sortingFileWriterConfig, metastore, location, stats, columnHandles); - Page truckPage = createPage(lineItem -> lineItem.getShipMode().equals("TRUCK")); - Page shipPage = createPage(lineItem -> lineItem.getShipMode().equals("SHIP")); + Page truckPage = createPage(lineItem -> lineItem.shipMode().equals("TRUCK")); + Page shipPage = createPage(lineItem -> lineItem.shipMode().equals("SHIP")); pageSink.appendPage(truckPage); pageSink.appendPage(shipPage); diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcPageSourceFactory.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcPageSourceFactory.java index 88521d96f1c1..53c5053967fd 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcPageSourceFactory.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/orc/TestOrcPageSourceFactory.java @@ -183,7 +183,7 @@ public void testFullFileReadOriginalFilesTable() assertThat(result.size()).isEqualTo(expected.size()); int deletedRowKey = 24; String deletedRowNameColumn = "UNITED STATES"; - assertThat(result.stream().anyMatch(acidNationRow -> acidNationRow.getName().equals(deletedRowNameColumn) && acidNationRow.getNationKey() == deletedRowKey)) + assertThat(result.stream().anyMatch(acidNationRow -> acidNationRow.name().equals(deletedRowNameColumn) && acidNationRow.nationKey() == deletedRowKey)) .describedAs("Deleted row shouldn't be present in the result") .isFalse(); } @@ -202,10 +202,10 @@ private static List expectedResult(OptionalLong nationKeyPredicate, Long { List expected = new ArrayList<>(); for (Nation nation : ImmutableList.copyOf(new NationGenerator().iterator())) { - if (nationKeyPredicate.isPresent() && nationKeyPredicate.getAsLong() != nation.getNationKey()) { + if (nationKeyPredicate.isPresent() && nationKeyPredicate.getAsLong() != nation.nationKey()) { continue; } - if (deletedRows.test(nation.getNationKey())) { + if (deletedRows.test(nation.nationKey())) { continue; } expected.addAll(nCopies(replicationFactor, nation)); @@ -344,10 +344,10 @@ private static void assertEqualsByColumns(Set columns, List"); - assertThat(actual.getRegionKey()).isEqualTo(columns.contains(REGION_KEY) ? expected.getRegionKey() : -42); - assertThat(actual.getComment()).isEqualTo(columns.contains(COMMENT) ? expected.getComment() : ""); + assertThat(actual.nationKey()).isEqualTo(columns.contains(NATION_KEY) ? expected.nationKey() : -42); + assertThat(actual.name()).isEqualTo(columns.contains(NAME) ? expected.name() : ""); + assertThat(actual.regionKey()).isEqualTo(columns.contains(REGION_KEY) ? expected.regionKey() : -42); + assertThat(actual.comment()).isEqualTo(columns.contains(COMMENT) ? expected.comment() : ""); } } diff --git a/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSetProvider.java b/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSetProvider.java index 67a99889e44d..a99cf9d1bc94 100644 --- a/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSetProvider.java +++ b/plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSetProvider.java @@ -103,7 +103,7 @@ public double getDouble(E entity) @Override public long getIdentifier(E entity) { - return entity.getRowNumber(); + return entity.rowNumber(); } @Override diff --git a/pom.xml b/pom.xml index 2daec3d0eb6c..cc78adf8d8dc 100644 --- a/pom.xml +++ b/pom.xml @@ -1645,7 +1645,7 @@ io.trino.tpch tpch - 1.2 + 1.4