Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Iceberg table statistics on inserts #15441

Merged
merged 9 commits into from
Mar 20, 2023
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)," +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much nicer :) But just wanted to point out that the preferred romanization is "Kyiv". Sadly, there's no timezone "Europe/Kyiv".

"('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