@@ -25,8 +25,8 @@ use crate::ast::helpers::stmt_data_loading::{
2525use crate :: ast:: {
2626 ColumnOption , ColumnPolicy , ColumnPolicyProperty , CopyIntoSnowflakeKind , Ident ,
2727 IdentityParameters , IdentityProperty , IdentityPropertyFormatKind , IdentityPropertyKind ,
28- IdentityPropertyOrder , ObjectName , RowAccessPolicy , ShowObjects , SqlOption , Statement ,
29- TagsColumnOption , WrappedCollection ,
28+ IdentityPropertyOrder , ObjectName , ObjectNamePart , RowAccessPolicy , ShowObjects , SqlOption ,
29+ Statement , TagsColumnOption , WrappedCollection ,
3030} ;
3131use crate :: dialect:: { Dialect , Precedence } ;
3232use crate :: keywords:: Keyword ;
@@ -368,8 +368,16 @@ impl Dialect for SnowflakeDialect {
368368 true
369369 }
370370
371- fn is_identifier_generating_function_name ( & self , ident : & Ident ) -> bool {
372- ident. quote_style . is_none ( ) && ident. value . to_lowercase ( ) == "identifier"
371+ fn is_identifier_generating_function_name (
372+ & self ,
373+ ident : & Ident ,
374+ name_parts : & [ ObjectNamePart ] ,
375+ ) -> bool {
376+ ident. quote_style . is_none ( )
377+ && ident. value . to_lowercase ( ) == "identifier"
378+ && !name_parts
379+ . iter ( )
380+ . any ( |p| matches ! ( p, ObjectNamePart :: Function ( _) ) )
373381 }
374382
375383 // For example: `SELECT IDENTIFIER('alias1').* FROM tbl AS alias1`
0 commit comments