From 976a908525a2bb4b4cce865bb1103bdb1a5399d4 Mon Sep 17 00:00:00 2001 From: chenjian2664 Date: Fri, 23 Dec 2022 13:54:41 +0800 Subject: [PATCH 1/2] Fix the behavior validation for CTAS test --- .../main/java/io/trino/testing/BaseConnectorTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java b/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java index df43b555b8423..49563e895f57b 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java @@ -2535,7 +2535,7 @@ public void testCreateTableSchemaNotFound() public void testCreateTableAsSelect() { String tableName = "test_ctas" + randomNameSuffix(); - if (!hasBehavior(SUPPORTS_CREATE_TABLE)) { + if (!hasBehavior(SUPPORTS_CREATE_TABLE_WITH_DATA)) { assertQueryFails("CREATE TABLE IF NOT EXISTS " + tableName + " AS SELECT name, regionkey FROM nation", "This connector does not support creating tables with data"); return; } @@ -2673,12 +2673,11 @@ protected void assertCreateTableAsSelect(Session session, @Language("SQL") Strin @Test public void testCreateTableAsSelectNegativeDate() { + // Covered by testCreateTableAsSelect + skipTestUnless(hasBehavior(SUPPORTS_CREATE_TABLE_WITH_DATA)); + String tableName = "negative_date_" + randomNameSuffix(); - if (!hasBehavior(SUPPORTS_CREATE_TABLE_WITH_DATA)) { - assertQueryFails(format("CREATE TABLE %s AS SELECT DATE '-0001-01-01' AS dt", tableName), "This connector does not support creating tables with data"); - return; - } if (!hasBehavior(SUPPORTS_NEGATIVE_DATE)) { assertQueryFails(format("CREATE TABLE %s AS SELECT DATE '-0001-01-01' AS dt", tableName), errorMessageForCreateTableAsSelectNegativeDate("-0001-01-01")); return; From e2d95a3d627d8c1052a7f3050d9e7e90aa7443e4 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Fri, 23 Dec 2022 16:34:04 +0900 Subject: [PATCH 2/2] empty