Skip to content

Commit

Permalink
Pick nicer test values
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 20, 2023
1 parent eb52882 commit 6c922ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public void testFromUnixTimeWithTimeZone()
assertThat(assertions.function("from_unixtime", "7200", "'Asia/Tokyo'"))
.matches("TIMESTAMP '1970-01-01 11:00:00.000 Asia/Tokyo'");

assertThat(assertions.function("from_unixtime", "7200", "'Europe/Moscow'"))
.matches("TIMESTAMP '1970-01-01 05:00:00.000 Europe/Moscow'");
assertThat(assertions.function("from_unixtime", "7200", "'Europe/Kiev'"))
.matches("TIMESTAMP '1970-01-01 05:00:00.000 Europe/Kiev'");

assertThat(assertions.function("from_unixtime", "7200", "'America/New_York'"))
.matches("TIMESTAMP '1969-12-31 21:00:00.000 America/New_York'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2925,22 +2925,22 @@ public void testTruncateTextTransform()
"('abcd', 1)," +
"('abxy', 2)," +
"('ab598', 3)," +
"('mommy', 4)," +
"('moscow', 5)," +
"('Kielce', 4)," +
"('Kiev', 5)," +
"('Greece', 6)," +
"('Grozny', 7)", 8);

assertQuery("SELECT partition.d_trunc FROM \"test_truncate_text_transform$partitions\"", "VALUES NULL, 'ab', 'mo', 'Gr'");
assertQuery("SELECT partition.d_trunc FROM \"test_truncate_text_transform$partitions\"", "VALUES NULL, 'ab', 'Ki', 'Gr'");

assertQuery("SELECT b FROM test_truncate_text_transform WHERE substring(d, 1, 2) = 'ab'", "VALUES 1, 2, 3");
assertQuery(
select + " WHERE partition.d_trunc = 'ab'",
format == AVRO ? "VALUES ('ab', 3, NULL, NULL, NULL, NULL)" : "VALUES ('ab', 3, 'ab598', 'abxy', 1, 3)");

assertQuery("SELECT b FROM test_truncate_text_transform WHERE substring(d, 1, 2) = 'mo'", "VALUES 4, 5");
assertQuery("SELECT b FROM test_truncate_text_transform WHERE substring(d, 1, 2) = 'Ki'", "VALUES 4, 5");
assertQuery(
select + " WHERE partition.d_trunc = 'mo'",
format == AVRO ? "VALUES ('mo', 2, NULL, NULL, NULL, NULL)" : "VALUES ('mo', 2, 'mommy', 'moscow', 4, 5)");
select + " WHERE partition.d_trunc = 'Ki'",
format == AVRO ? "VALUES ('Ki', 2, NULL, NULL, NULL, NULL)" : "VALUES ('Ki', 2, 'Kielce', 'Kiev', 4, 5)");

assertQuery("SELECT b FROM test_truncate_text_transform WHERE substring(d, 1, 2) = 'Gr'", "VALUES 6, 7");
assertQuery(
Expand All @@ -2955,7 +2955,7 @@ public void testTruncateTextTransform()
assertThat(query("SHOW STATS FOR test_truncate_text_transform"))
.skippingTypesCheck()
.matches("VALUES " +
" ('d', " + (format == PARQUET ? "553e0" : "NULL") + ", NULL, " + (format == AVRO ? "NULL" : "0.125e0") + ", NULL, NULL, NULL), " +
" ('d', " + (format == PARQUET ? "550e0" : "NULL") + ", NULL, " + (format == AVRO ? "NULL" : "0.125e0") + ", NULL, NULL, NULL), " +
(format == AVRO ? " ('b', NULL, NULL, NULL, NULL, NULL, NULL), " : " ('b', NULL, NULL, 0e0, NULL, '1', '101'), ") +
" (NULL, NULL, NULL, NULL, 8e0, NULL, NULL)");

Expand Down Expand Up @@ -3228,8 +3228,8 @@ public void testApplyFilterWithNonEmptyConstraintPredicate()
"('abcd', 1)," +
"('abxy', 2)," +
"('ab598', 3)," +
"('mommy', 4)," +
"('moscow', 5)," +
"('Kielce', 4)," +
"('Kiev', 5)," +
"('Greece', 6)," +
"('Grozny', 7)",
7);
Expand All @@ -3247,7 +3247,7 @@ public void testApplyFilterWithNonEmptyConstraintPredicate()
}
if (format == PARQUET) {
expected = "VALUES " +
" ('d', 367e0, NULL, 0e0, NULL, NULL, NULL), " +
" ('d', 364e0, NULL, 0e0, NULL, NULL, NULL), " +
" ('b', NULL, NULL, 0e0, NULL, '1', '7'), " +
" (NULL, NULL, NULL, NULL, 7e0, NULL, NULL)";
}
Expand Down

0 comments on commit 6c922ac

Please sign in to comment.