Skip to content

Commit

Permalink
Add missing test case to TestBlockAndPositionNullConvention
Browse files Browse the repository at this point in the history
Looks like it got lost during the refactoring in commit
98c5243. 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.
  • Loading branch information
ksobolew authored and findepi committed Feb 5, 2024
1 parent 341cd20 commit 46e991e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 46e991e

Please sign in to comment.