File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
packages/transform/src/transformers Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -110,9 +110,24 @@ export class V13ToV14Transformer {
110110 const result : any = { } ;
111111
112112 if ( node . funcname !== undefined ) {
113- result . funcname = Array . isArray ( node . funcname )
113+ let funcname = Array . isArray ( node . funcname )
114114 ? node . funcname . map ( item => this . transform ( item as any , context ) )
115115 : this . transform ( node . funcname as any , context ) ;
116+
117+ if ( Array . isArray ( funcname ) && funcname . length >= 2 ) {
118+ const lastName = funcname [ funcname . length - 1 ] ;
119+ if ( lastName && typeof lastName === 'object' && 'String' in lastName ) {
120+ const funcName = lastName . String . str || lastName . String . sval ;
121+ if ( funcName === 'date_part' ) {
122+ funcname = [ ...funcname ] ;
123+ funcname [ funcname . length - 1 ] = {
124+ String : { str : 'extract' }
125+ } ;
126+ }
127+ }
128+ }
129+
130+ result . funcname = funcname ;
116131 }
117132
118133 if ( node . args !== undefined ) {
You can’t perform that action at this time.
0 commit comments