Update 03274_aliases_in_udf.sql

This commit is contained in:
Yarik Briukhovetskyi 2024-11-21 12:37:07 +01:00 committed by GitHub
parent 7dcaacab9d
commit 05b0ae9faa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,10 @@
-- Tags: no-parallel
SELECT 'FIX ISSUE #69143';
DROP FUNCTION IF EXISTS test_function;
DROP FUNCTION IF EXISTS test_03274;
DROP TABLE IF EXISTS test_table;
CREATE OR REPLACE FUNCTION test_function AS ( input_column_name ) -> ((
CREATE FUNCTION IF NOT EXISTS 03274_test_function AS ( input_column_name ) -> ((
'1' AS a,
input_column_name AS input_column_name
).2);
@ -18,10 +18,10 @@ ENGINE = MergeTree()
ORDER BY tuple();
ALTER TABLE test_table ADD COLUMN mat_a String MATERIALIZED test_function(metadata_a);
ALTER TABLE test_table ADD COLUMN mat_a String MATERIALIZED 03274_test_function(metadata_a);
ALTER TABLE test_table MATERIALIZE COLUMN `mat_a`;
ALTER TABLE test_table ADD COLUMN mat_b String MATERIALIZED test_function(metadata_b);
ALTER TABLE test_table ADD COLUMN mat_b String MATERIALIZED 03274_test_function(metadata_b);
ALTER TABLE test_table MATERIALIZE COLUMN `mat_b`;
INSERT INTO test_table SELECT 'a', 'b';
@ -31,10 +31,10 @@ SELECT mat_b FROM test_table;
SELECT 'EXPAIN SYNTAX OF UDF';
CREATE OR REPLACE FUNCTION test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPAIN SYNTAX SELECT test_03274(4 + 2);
DROP FUNCTION IF EXISTS test_function;
DROP FUNCTION IF EXISTS test_03274;
DROP FUNCTION 03274_test_function;
DROP FUNCTION test_03274;
DROP TABLE IF EXISTS test_table;