On Wed, Apr 3, 2024 at 11:30 AM jian he <jian.universal...@gmail.com> wrote: > > On Tue, Apr 2, 2024 at 9:57 PM Amit Langote <amitlangot...@gmail.com> wrote: > > > > Please let me know if you have further comments on 0001. I'd like to > > get that in before spending more energy on 0002. > >
-- a/src/backend/parser/parse_target.c +++ b/src/backend/parser/parse_target.c @@ -2019,6 +2019,9 @@ FigureColnameInternal(Node *node, char **name) case JSON_VALUE_OP: *name = "json_value"; return 2; + case JSON_TABLE_OP: + *name = "json_table"; + return 2; default: elog(ERROR, "unrecognized JsonExpr op: %d", (int) ((JsonFuncExpr *) node)->op); "case JSON_TABLE_OP part", no need? json_table output must provide column name and type? I did some minor refactor transformJsonTableColumns, make the comments align with the function intention. in v48-0001, in transformJsonTableColumns we can `Assert(rawc->name);`. since non-nested JsonTableColumn must specify column name. in v48-0002, we can change to `if (rawc->coltype != JTC_NESTED) Assert(rawc->name);` SELECT * FROM JSON_TABLE(jsonb '1', '$' COLUMNS (a int PATH '$.a' ) ERROR ON ERROR) jt; ERROR: no SQL/JSON item I thought it should just return NULL. In this case, I thought that (not column-level) ERROR ON ERROR should not interfere with "COLUMNS (a int PATH '$.a' )". +-- Other miscellanous checks "miscellanous" should be "miscellaneous". overall the coverage is pretty high. the current test output looks fine.
v48-0001-minor-refactor-transformJsonTableColumns.only_for_v48_0001
Description: Binary data