From 99ca0ff2aaa4edf876889597d164f95fef195140 Mon Sep 17 00:00:00 2001 From: Krzysztof Sobolewski Date: Mon, 31 Jul 2023 11:10:53 +0200 Subject: [PATCH] Add missing test case to TestBlockAndPositionNullConvention Looks like it got lost during the refactoring in commit 98c5243898e7068b264b2fef26021b6249eff7c9. Originally it used `null` for a generic object type, but perhaps a "real" object like row is better here. This was detected by the write-only object inspection in IDEA: the `hitBlockPositionObject` was reported as never read from. --- .../operator/scalar/TestBlockAndPositionNullConvention.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/trino-main/src/test/java/io/trino/operator/scalar/TestBlockAndPositionNullConvention.java b/core/trino-main/src/test/java/io/trino/operator/scalar/TestBlockAndPositionNullConvention.java index 37dfe0175a3a..cd80d0f1d3ce 100644 --- a/core/trino-main/src/test/java/io/trino/operator/scalar/TestBlockAndPositionNullConvention.java +++ b/core/trino-main/src/test/java/io/trino/operator/scalar/TestBlockAndPositionNullConvention.java @@ -13,6 +13,7 @@ */ package io.trino.operator.scalar; +import com.google.common.collect.ImmutableList; import io.airlift.slice.Slice; import io.trino.metadata.InternalFunctionBundle; import io.trino.spi.block.ValueBlock; @@ -83,6 +84,10 @@ public void testBlockPosition() assertThat(assertions.function("test_block_position", "true")) .isEqualTo(true); assertThat(FunctionWithBlockAndPositionConvention.hitBlockPositionBoolean.get()).isTrue(); + + assertThat(assertions.function("test_block_position", "ROW(1234)")) + .isEqualTo(ImmutableList.of(1234)); + assertThat(FunctionWithBlockAndPositionConvention.hitBlockPositionObject.get()).isTrue(); } @ScalarFunction("test_block_position")