Make SHOW STATS tests less flaky
@@ -265,24 +265,24 @@ public class TestHiveTableStatistics
row("c_boolean", null, null, null, null),
row("c_binary", null, null, null, null),
row(null, null, null, null, 1.0));
-
onHive().executeQuery("ANALYZE TABLE " + tableNameInDatabase + " COMPUTE STATISTICS FOR COLUMNS");
+ // SHOW STATS FORMAT: column_name, data_size, distinct_values_count, nulls_fraction, row_count
assertThat(query("SHOW STATS FOR " + tableNameInDatabase)).containsOnly(
- row("c_tinyint", null, 1.0, 0.0, null),
- row("c_smallint", null, 1.0, 0.0, null),
- row("c_int", null, 2.0, 0.0, null),
- row("c_bigint", null, 1.0, 0.0, null),
- row("c_float", null, 1.0, 0.0, null),
- row("c_double", null, 1.0, 0.0, null),
- row("c_decimal", null, 1.0, 0.0, null),
- row("c_decimal_w_params", null, 1.0, 0.0, null),
- row("c_timestamp", null, 1.0, 0.0, null),
- row("c_date", null, 2.0, 0.0, null),
- row("c_string", null, 1.0, 0.0, null),
- row("c_varchar", null, 1.0, 0.0, null),
- row("c_char", null, 1.0, 0.0, null),
- row("c_boolean", null, 1.0, 0.0, null),
+ row("c_tinyint", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_smallint", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_int", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_bigint", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_float", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_double", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_decimal", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_decimal_w_params", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_timestamp", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_date", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_string", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_varchar", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_char", null, anyOf(1.0, 2.0), 0.0, null),
+ row("c_boolean", null, anyOf(1.0, 2.0), 0.0, null),
row("c_binary", null, null, 0.0, null),
row(null, null, null, null, 1.0));
}
