Closed cvng closed 10 months ago
feat: support DefineStmt (aggregate): create aggregate ...
DefineStmt
create aggregate ...
Parser panics
pg_query_root: Some( DefineStmt( DefineStmt { kind: ObjectAggregate, oldstyle: false, defnames: [ Node { node: Some( String( String { sval: "percentile_disc", }, ), ), }, ], args: [ Node { node: Some( List( List { items: [ Node { node: Some( FunctionParameter( FunctionParameter { name: "", arg_type: Some( TypeName { names: [ Node { node: Some( String( String { sval: "float8", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 45, }, ), mode: FuncParamDefault, defexpr: None, }, ), ), }, Node { node: Some( FunctionParameter( FunctionParameter { name: "", arg_type: Some( TypeName { names: [ Node { node: Some( String( String { sval: "anyelement", // appears once }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 61, }, ), mode: FuncParamDefault, defexpr: None, }, ), ), }, ], }, ), ), }, Node { node: Some( Integer( Integer { ival: 1, }, ), ), }, ], definition: [ Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "sfunc", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "ordered_set_transition", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 99, }, ), ), }, ), defaction: DefelemUnspec, location: 91, }, ), ), }, Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "stype", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "internal", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 147, }, ), ), }, ), defaction: DefelemUnspec, location: 139, }, ), ), }, Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "finalfunc", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "percentile_disc_final", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 185, }, ), ), }, ), defaction: DefelemUnspec, location: 173, }, ), ), }, Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "finalfunc_extra", arg: None, defaction: DefelemUnspec, location: 224, }, ), ), }, ], if_not_exists: false, replace: true, }, ), )
Add any other context or screenshots.
included in #72 - lmk if we can close this @cvng
included in #72
What kind of change does this PR introduce?
feat: support
DefineStmt
(aggregate):create aggregate ...
What is the current behavior?
Parser panics
What is the new behavior?
Additional context
Add any other context or screenshots.