From 623354c02d98f4f93894d95e34d32ab80fe1da41 Mon Sep 17 00:00:00 2001 From: seawinde Date: Fri, 25 Oct 2024 11:45:51 +0800 Subject: [PATCH] fix regression test --- .../cte/test_cte_with_duplicate_consumer.groovy | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/regression-test/suites/nereids_p0/cte/test_cte_with_duplicate_consumer.groovy b/regression-test/suites/nereids_p0/cte/test_cte_with_duplicate_consumer.groovy index 4064efcfc6e2e9..b5cb03ea174405 100644 --- a/regression-test/suites/nereids_p0/cte/test_cte_with_duplicate_consumer.groovy +++ b/regression-test/suites/nereids_p0/cte/test_cte_with_duplicate_consumer.groovy @@ -14,12 +14,22 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. +import org.junit.Assert; suite("test_cte_with_duplicate_consumer") { - test { + try { sql """ WITH cte1(col1) AS (SELECT 1), cte2(col2_1, col2_2) AS (SELECT col1, col1 FROM cte1) SELECT * FROM cte2 """ + } catch (Exception e) { + // Duplicated inline view column alias: 'col1' in inline view: 'cte2'' + assertTrue(e.message.contains(" Duplicated inline view column alias")) + } + + test { + sql """ + WITH cte1(col1) AS (SELECT 1), cte2(col2_1) AS (SELECT col1 FROM cte1) SELECT * FROM cte2 + """ - result([[1, 1]]) + result([[1]]) } }