Skip to content

Retry Hive view tests on HS2 failure #17723

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public abstract class AbstractTestHiveViews
extends HiveProductTest
{
@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testSelectOnView()
{
onHive().executeQuery("DROP VIEW IF EXISTS hive_test_view");
Expand All @@ -78,6 +79,7 @@ public void testSelectOnView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testArrayIndexingInView()
{
onHive().executeQuery("DROP TABLE IF EXISTS test_hive_view_array_index_table");
Expand All @@ -100,6 +102,7 @@ public void testArrayIndexingInView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testCommonTableExpression()
{
onHive().executeQuery(
Expand All @@ -113,6 +116,7 @@ public void testCommonTableExpression()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testNestedCommonTableExpression()
{
onHive().executeQuery(
Expand All @@ -127,6 +131,7 @@ public void testNestedCommonTableExpression()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testArrayConstructionInView()
{
onHive().executeQuery("DROP VIEW IF EXISTS test_array_construction_view");
Expand All @@ -139,6 +144,7 @@ public void testArrayConstructionInView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testMapConstructionInView()
{
onHive().executeQuery(
Expand All @@ -158,6 +164,7 @@ public void testMapConstructionInView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testSelectOnViewFromDifferentSchema()
{
onHive().executeQuery("DROP SCHEMA IF EXISTS test_schema CASCADE");
Expand All @@ -171,6 +178,7 @@ public void testSelectOnViewFromDifferentSchema()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testViewReferencingTableInDifferentSchema()
{
String schemaX = "test_view_table_in_different_schema_x" + randomNameSuffix();
Expand All @@ -191,6 +199,7 @@ public void testViewReferencingTableInDifferentSchema()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testViewReferencingTableInTheSameSchemaWithoutQualifier()
{
String schemaX = "test_view_table_same_schema_without_qualifier_schema" + randomNameSuffix();
Expand All @@ -209,6 +218,7 @@ public void testViewReferencingTableInTheSameSchemaWithoutQualifier()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
// TODO (https://github.com/trinodb/trino/issues/5911) the test does not test view coercion
public void testViewWithUnsupportedCoercion()
{
Expand All @@ -220,6 +230,7 @@ public void testViewWithUnsupportedCoercion()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testOuterParentheses()
{
if (getHiveVersionMajor() <= 1) {
Expand All @@ -235,6 +246,7 @@ public void testOuterParentheses()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testDateFunction()
{
onHive().executeQuery("DROP TABLE IF EXISTS hive_table_date_function");
Expand All @@ -250,6 +262,7 @@ public void testDateFunction()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testPmodFunction()
{
onHive().executeQuery("DROP TABLE IF EXISTS hive_table_pmod_function");
Expand All @@ -265,6 +278,7 @@ public void testPmodFunction()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
// TODO (https://github.com/trinodb/trino/issues/5911) the test does not test view coercion
public void testWithUnsupportedFunction()
{
Expand All @@ -276,6 +290,7 @@ public void testWithUnsupportedFunction()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testExistingView()
{
onHive().executeQuery("DROP VIEW IF EXISTS hive_duplicate_view");
Expand All @@ -286,6 +301,7 @@ public void testExistingView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testShowCreateView()
{
onHive().executeQuery("DROP VIEW IF EXISTS hive_show_view");
Expand Down Expand Up @@ -349,6 +365,7 @@ public void testRichSqlSyntax()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testIdentifierThatStartWithDigit()
{
onTrino().executeQuery("DROP TABLE IF EXISTS \"7_table_with_number\"");
Expand All @@ -363,6 +380,7 @@ public void testIdentifierThatStartWithDigit()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testHiveViewInInformationSchema()
{
onHive().executeQuery("DROP SCHEMA IF EXISTS test_schema CASCADE");
Expand All @@ -389,6 +407,7 @@ public void testHiveViewInInformationSchema()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testHiveViewWithParametrizedTypes()
{
onHive().executeQuery("DROP VIEW IF EXISTS hive_view_parametrized");
Expand All @@ -409,6 +428,7 @@ public void testHiveViewWithParametrizedTypes()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testHiveViewWithTextualTypes()
{
onHive().executeQuery("DROP VIEW IF EXISTS hive_view_textual");
Expand Down Expand Up @@ -436,6 +456,7 @@ public void testHiveViewWithTextualTypes()
protected abstract List<QueryAssert.Row> getExpectedHiveViewTextualColumnsTypes();

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testNestedHiveViews()
{
onHive().executeQuery("DROP VIEW IF EXISTS nested_base_view");
Expand All @@ -452,6 +473,7 @@ public void testNestedHiveViews()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testSelectFromHiveViewWithoutDefaultCatalogAndSchema()
{
onHive().executeQuery("DROP VIEW IF EXISTS no_catalog_schema_view");
Expand All @@ -465,6 +487,7 @@ public void testSelectFromHiveViewWithoutDefaultCatalogAndSchema()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testTimestampHiveView()
{
onHive().executeQuery("DROP TABLE IF EXISTS timestamp_hive_table");
Expand Down Expand Up @@ -497,6 +520,7 @@ public void testTimestampHiveView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testCurrentUser()
{
onHive().executeQuery("DROP VIEW IF EXISTS current_user_hive_view");
Expand All @@ -508,6 +532,7 @@ public void testCurrentUser()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testNestedGroupBy()
{
onHive().executeQuery("DROP VIEW IF EXISTS test_nested_group_by_view");
Expand Down Expand Up @@ -596,6 +621,7 @@ public void testUnionDistinctViews()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testHivePartitionViews()
{
onHive().executeQuery("DROP VIEW IF EXISTS test_view_partitioned_column");
Expand All @@ -615,6 +641,7 @@ public void testHivePartitionViews()
* any potential view translation to follow redirections.
*/
@Test(groups = {HIVE_ICEBERG_REDIRECTIONS, PROFILE_SPECIFIC_TESTS})
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testViewReferencingHiveAndIcebergTables()
{
onTrino().executeQuery("DROP TABLE IF EXISTS iceberg.default.view_iceberg_table_actual_data");
Expand Down Expand Up @@ -698,6 +725,7 @@ public void testViewReferencingHiveAndIcebergTables()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testViewWithColumnAliasesDifferingInCase()
{
onHive().executeQuery("DROP TABLE IF EXISTS test_hive_namesake_column_name_a");
Expand All @@ -724,6 +752,7 @@ public void testViewWithColumnAliasesDifferingInCase()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testRunAsInvoker()
{
onTrino().executeQuery("DROP TABLE IF EXISTS run_as_invoker");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.trino.tempto.assertions.QueryAssert;
import io.trino.tempto.fulfillment.table.hive.tpch.ImmutableTpchTablesRequirements.ImmutableNationTable;
import io.trino.tempto.fulfillment.table.hive.tpch.ImmutableTpchTablesRequirements.ImmutableOrdersTable;
import io.trino.testng.services.Flaky;
import org.assertj.core.api.Assertions;
import org.testng.annotations.Test;

Expand All @@ -29,6 +30,8 @@
import static io.trino.tempto.assertions.QueryAssert.assertQueryFailure;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tests.product.TestGroups.HIVE_VIEWS;
import static io.trino.tests.product.utils.HadoopTestUtils.RETRYABLE_FAILURES_ISSUES;
import static io.trino.tests.product.utils.HadoopTestUtils.RETRYABLE_FAILURES_MATCH;
import static io.trino.tests.product.utils.QueryExecutors.onHive;
import static io.trino.tests.product.utils.QueryExecutors.onTrino;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand All @@ -53,6 +56,7 @@ protected List<QueryAssert.Row> getExpectedHiveViewTextualColumnsTypes()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testFailingHiveViewsWithMetadataListing()
{
setupBrokenView();
Expand Down Expand Up @@ -164,6 +168,7 @@ private static void setupBrokenView()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testLateralViewExplode()
{
onTrino().executeQuery("DROP TABLE IF EXISTS pageAds");
Expand Down Expand Up @@ -199,6 +204,7 @@ public void testLateralViewExplode()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testLateralViewExplodeArrayOfStructs()
{
onTrino().executeQuery("DROP TABLE IF EXISTS pageAdsStructs");
Expand Down Expand Up @@ -235,6 +241,7 @@ public void testLateralViewExplodeArrayOfStructs()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testLateralViewJsonTupleAs()
{
onTrino().executeQuery("DROP TABLE IF EXISTS test_json_tuple_table");
Expand All @@ -253,6 +260,7 @@ public void testLateralViewJsonTupleAs()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testFromUtcTimestamp()
{
onTrino().executeQuery("DROP TABLE IF EXISTS test_from_utc_timestamp_source");
Expand Down Expand Up @@ -388,6 +396,7 @@ public void testFromUtcTimestamp()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testFromUtcTimestampInvalidTimeZone()
{
onTrino().executeQuery("DROP TABLE IF EXISTS test_from_utc_timestamp_invalid_time_zone_source");
Expand All @@ -413,6 +422,7 @@ public void testFromUtcTimestampInvalidTimeZone()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testNestedFieldWithReservedKeyNames()
{
onTrino().executeQuery("DROP TABLE IF EXISTS test_nested_field_with_reserved_key_names_source");
Expand Down Expand Up @@ -446,6 +456,7 @@ public void testNestedFieldWithReservedKeyNames()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testFromUtcTimestampCornerCases()
{
onTrino().executeQuery("DROP TABLE IF EXISTS test_from_utc_timestamp_corner_cases_source");
Expand Down Expand Up @@ -506,6 +517,7 @@ private boolean isObsoleteFromUtcTimestampSemantics()
}

@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testCastTimestampAsDecimal()
{
onHive().executeQuery("DROP TABLE IF EXISTS cast_timestamp_as_decimal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.trino.tempto.fulfillment.table.hive.tpch.ImmutableTpchTablesRequirements.ImmutableNationTable;
import io.trino.tempto.fulfillment.table.hive.tpch.ImmutableTpchTablesRequirements.ImmutableOrdersTable;
import io.trino.tempto.query.QueryExecutor;
import io.trino.testng.services.Flaky;
import org.testng.annotations.Test;

import java.math.BigDecimal;
Expand All @@ -28,6 +29,8 @@
import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tests.product.TestGroups.HIVE_VIEWS;
import static io.trino.tests.product.utils.HadoopTestUtils.RETRYABLE_FAILURES_ISSUES;
import static io.trino.tests.product.utils.HadoopTestUtils.RETRYABLE_FAILURES_MATCH;
import static io.trino.tests.product.utils.QueryExecutors.onHive;
import static io.trino.tests.product.utils.QueryExecutors.onTrino;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down Expand Up @@ -118,20 +121,26 @@ public void testArrayIndexingInView()
}

@Override
@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testArrayConstructionInView()
{
assertThatThrownBy(super::testArrayConstructionInView)
.hasMessageContaining("Function 'array' not registered");
}

@Override
@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testMapConstructionInView()
{
assertThatThrownBy(super::testMapConstructionInView)
.hasMessageContaining("Unexpected parameters (varchar(15), varchar(15)) for function map");
}

@Override
@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testPmodFunction()
{
assertThatThrownBy(super::testPmodFunction)
Expand All @@ -151,6 +160,8 @@ protected List<QueryAssert.Row> getExpectedHiveViewTextualColumnsTypes()
}

@Override
@Test(groups = HIVE_VIEWS)
@Flaky(issue = RETRYABLE_FAILURES_ISSUES, match = RETRYABLE_FAILURES_MATCH)
public void testNestedHiveViews()
{
assertThatThrownBy(super::testNestedHiveViews)
Expand Down