Skip to content

Commit

Permalink
Add Another Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarrowstone committed Jan 10, 2025
1 parent 0844bfa commit 3ec6cd2
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,28 @@ public void testNonStructTlvPathExtraction()
List.of(List.of(19, 23)));
}

/**
* Shows how users can configure mapping sequence positions from Ion values to a Trino row.
*/
@Test
public void testPositionalPathExtraction()
throws IOException
{
Map<String, String> pathExtractions = Map.of(
"foo", "(0)",
"bar", "(1)");
RowType rowType = RowType.rowType(
field("foo", INTEGER),
field("bar", VARCHAR));

assertValues(
rowType,
new IonDecoderConfig(pathExtractions, true),
"[13, baz] [17, qux]",
List.of(13, "baz"),
List.of(17, "qux"));
}

@Test
public void testEncode()
throws IOException
Expand Down

0 comments on commit 3ec6cd2

Please sign in to comment.