Skip to content

Commit

Permalink
Avoid initializing expected to null
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 20, 2023
1 parent 6c922ac commit 1370c2e
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3238,25 +3238,20 @@ public void testApplyFilterWithNonEmptyConstraintPredicate()
"SELECT * FROM test_apply_functional_constraint WHERE length(d) = 4 AND b % 7 = 2",
"VALUES ('abxy', 2)");

String expected = null;
if (format == ORC) {
expected = "VALUES " +
String expected = switch (format) {
case ORC -> "VALUES " +
" ('d', NULL, NULL, 0e0, NULL, NULL, NULL), " +
" ('b', NULL, NULL, 0e0, NULL, '1', '7'), " +
" (NULL, NULL, NULL, NULL, 7e0, NULL, NULL)";
}
if (format == PARQUET) {
expected = "VALUES " +
case PARQUET -> "VALUES " +
" ('d', 364e0, NULL, 0e0, NULL, NULL, NULL), " +
" ('b', NULL, NULL, 0e0, NULL, '1', '7'), " +
" (NULL, NULL, NULL, NULL, 7e0, NULL, NULL)";
}
else if (format == AVRO) {
expected = "VALUES " +
case AVRO -> "VALUES " +
" ('d', NULL, NULL, NULL, NULL, NULL, NULL), " +
" ('b', NULL, NULL, NULL, NULL, NULL, NULL), " +
" (NULL, NULL, NULL, NULL, 7e0, NULL, NULL)";
}
};
assertThat(query("SHOW STATS FOR test_apply_functional_constraint"))
.skippingTypesCheck()
.matches(expected);
Expand Down

0 comments on commit 1370c2e

Please sign in to comment.