apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
11.84k stars 3.12k forks source link

[Fix](nereids) add backquote and qualifier to udf, column, column alias and table alias when create view #37237

Open feiniaofeiafei opened 2 days ago

feiniaofeiafei commented 2 days ago

In the create view statement, the database actually saves a SQL string. In the previous implementation of nereids create view, the database name qualifier was not added to the UDF function used in SQL. This will cause errors when switching the database to use view. This pr adds database restrictions to udf. For example:

select udf_function(a) 

will be converted to

select `db`.`udf_function`(a)

At the same time, this PR also adds backquote to column and alias.

feiniaofeiafei commented 2 days ago

run buildall

feiniaofeiafei commented 2 days ago

run buildall