SQL/JSON: JSON_TABLE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached patches implementing JSON_TABLE.

This patchset depends on the 8th version of SQL/JSON functions patchset
that was posted in
https://www.postgresql.org/message-id/cd0bb935-0158-78a7-08b5-904886deac4b%40postgrespro.ru

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0012-json_table-v08.patch (132K) Download Attachment
0013-json_table-json-v08.patch (49K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 9th version of JSON_TABLE patches rebased onto the latest master.

Documentation drafts written by Oleg Bartunov:
https://github.com/obartunov/sqljsondoc

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0011-json_table-v09.patch (132K) Download Attachment
0012-json_table-json-v09.patch (49K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 10th version of JSON_TABLE patches rebased onto the latest master.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0013-json_table-v10.patch (132K) Download Attachment
0014-json_table-json-v10.patch (49K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 11th version of JSON_TABLE patches rebased onto the latest master.

Fixed PLAN DEFAULT flags assignment in gram.y.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0013-json_table-v11.patch (132K) Download Attachment
0014-json_table-json-v11.patch (49K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 12th version of JSON_TABLE patches rebased onto the latest master.

Fixed JSON_TABLE plan validation.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0014-json_table-v12.patch (133K) Download Attachment
0015-json_table-json-v12.patch (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 13th version of JSON_TABLE patches rebased onto the latest master.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0014-json_table-v13.patch (133K) Download Attachment
0015-json_table-json-v13.patch (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 15th version of JSON_TABLE patches.

Implicit root path name assignment was disabled (it is unclear from standard).
Now all JSON path names are required if the explicit PLAN clause is used.


The documentation for JSON_TABLE can be found now in a separate patch:
https://www.postgresql.org/message-id/732208d3-56c3-25a4-8f08-3be1d54ad51b%40postgrespro.ru

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


0015-json_table-v15.patch (134K) Download Attachment
0016-json_table-json-v15.patch (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 16th version of JSON_TABLE patches.

Changed only results of regression tests after the implicit coercion via I/O
was removed from JSON_VALUE.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


0015-json_table-v16.patch (133K) Download Attachment
0016-json_table-json-v16.patch (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Dmitry Dolgov
> On Tue, Jul 3, 2018 at 4:50 PM Nikita Glukhov <[hidden email]> wrote:
>
> Attached 16th version of JSON_TABLE patches.
>
> Changed only results of regression tests after the implicit coercion via I/O
> was removed from JSON_VALUE.

Thank you for working on this patch! Unfortunately, the current version of
patch 0015-json_table doesn't not apply anymore without conflicts, could you
please rebase it? In the meantime I'll try to provide some review.

Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
On 26.11.2018 15:55, Dmitry Dolgov wrote:

>> On Tue, Jul 3, 2018 at 4:50 PM Nikita Glukhov <[hidden email]> wrote:
>>
>> Attached 16th version of JSON_TABLE patches.
>>
>> Changed only results of regression tests after the implicit coercion via I/O
>> was removed from JSON_VALUE.
> Thank you for working on this patch! Unfortunately, the current version of
> patch 0015-json_table doesn't not apply anymore without conflicts, could you
> please rebase it? In the meantime I'll try to provide some review.

Attached 20th version of the patches rebased onto the current master.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0010-JSON_TABLE-v20.patch (136K) Download Attachment
0011-JSON_TABLE-for-json-type-v20.patch (51K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 21st version of the patches rebased onto the current master.


You can also see all SQL/JSON v21 patches successfully applied in our GitHub 
repository on the following branches:
https://github.com/postgrespro/sqljson/tree/sqljson_v21  (one commit per patch)
https://github.com/postgrespro/sqljson/tree/sqljson   (original commit history)
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0012-JSON_TABLE-v21.patch (136K) Download Attachment
0013-JSON_TABLE-for-json-type-v21.patch (51K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 34th version of the patches.
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0009-Implementation-of-JSON_TABLE-v34.patch (184K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Robert Haas
On Thu, Feb 28, 2019 at 8:19 PM Nikita Glukhov <[hidden email]> wrote:
> Attached 34th version of the patches.

Kinda strange version numbering -- the last post on this thread is v21.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov

On 01.03.2019 19:17, Robert Haas wrote:

On Thu, Feb 28, 2019 at 8:19 PM Nikita Glukhov [hidden email] wrote:
Attached 34th version of the patches.
Kinda strange version numbering -- the last post on this thread is v21.
For simplicity of dependence tracking, version numbering of JSON_TABLE patches
matches the version numbering of the patches on which it  depends -- jsonpath
and SQL/JSON.  The corresponding jsonpath patch has version v34 now.

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov
Attached 36th version of patches rebased onto jsonpath v36.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


0001-Implementation-of-SQL-JSON-path-language.patch.gz (246K) Download Attachment
0002-JSON_TABLE.patch.gz (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Pavel Stehule
Hi

so 29. 6. 2019 v 7:26 odesílatel Nikita Glukhov <[hidden email]> napsal:
Attached 36th version of patches rebased onto jsonpath v36.

I cannot to apply these patches on master. Please, can you check these patches?

Regards

Pavel

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov

On 29.06.2019 8:40, Pavel Stehule wrote:

Hi

so 29. 6. 2019 v 7:26 odesílatel Nikita Glukhov <[hidden email]> napsal:
Attached 36th version of patches rebased onto jsonpath v36.

I cannot to apply these patches on master. Please, can you check these patches?


Attached 37th version of patches rebased onto current master.

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0001-SQLJSON-functions-v37.patch.gz (181K) Download Attachment
0002-JSON_TABLE.patch.gz (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Pavel Stehule
Hi

út 16. 7. 2019 v 16:06 odesílatel Nikita Glukhov <[hidden email]> napsal:

On 29.06.2019 8:40, Pavel Stehule wrote:

Hi

so 29. 6. 2019 v 7:26 odesílatel Nikita Glukhov <[hidden email]> napsal:
Attached 36th version of patches rebased onto jsonpath v36.

I cannot to apply these patches on master. Please, can you check these patches?


Attached 37th version of patches rebased onto current master.

I got warning

ar crs libpgcommon.a base64.o config_info.o controldata_utils.o d2s.o exec.o f2s.o file_perm.o ip.o keywords.o kwlookup.o link-canary.o md5.o pg_lzcompress.o pgfnames.o psprintf.o relpath.o rmtree.o saslprep.o scram-common.o string.o unicode_norm.o username.o wait_error.>
...skipping...
clauses.c:1076:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
 1076 |   if (ExecEvalJsonNeedsSubTransaction(jsexpr, NULL))
      |   ^~
clauses.c:1078:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 1078 |    return true;
      |    ^~~~~~
gcc -Wall -Wmissing-protot

Regress tests diff is not empty - see attached file

some strange fragments from code:

    deparseExpr(node->arg, context);
-   if (node->relabelformat != COERCE_IMPLICIT_CAST)
+   if (node->relabelformat != COERCE_IMPLICIT_CAST &&
+       node->relabelformat == COERCE_INTERNAL_CAST)


Now, "format"  is type_func_name_keyword, so when you use it, then nobody can use "format" as column name. It can break lot of application. "format" is common name. It is relatively unhappy, and it can touch lot of users.

This patch set (JSON functions & JSON_TABLE) has more tha 20K rows. More, there are more than few features are implemented.

Is possible to better (deeper) isolate these features, please? I have nothing against any implemented feature, but it is hard to work intensively (hard test) on this large patch. JSON_TABLE has only 184kB, can we start with this patch?

SQLJSON_FUNCTIONS has 760kB - it is maybe too much for one feature, one patch.


Pavel



--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

regression.diffs (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Alvaro Herrera-9
In reply to this post by Nikita Glukhov
Now this is one giant patchset ... and at least the first patch seems to
have more than one thing within -- even the commit message says so.  It
seems clear that this is going to take a long time to digest; maybe if
we can get it in smaller pieces we can try to have a little at a time?
In other words, may I suggest to split it up in pieces that can be
reviewed and committed independently?

v37 no longer applies so it requires a rebase, and also typedefs.list
was wrongly merged.

Please update.

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply | Threaded
Open this post in threaded view
|

Re: SQL/JSON: JSON_TABLE

Nikita Glukhov

On 03.09.2019 20:29, Alvaro Herrera wrote:

Now this is one giant patchset ... and at least the first patch seems to
have more than one thing within -- even the commit message says so.  It
seems clear that this is going to take a long time to digest; maybe if
we can get it in smaller pieces we can try to have a little at a time?
In other words, may I suggest to split it up in pieces that can be
reviewed and committed independently?
Patch 0001 is simply a squash of all 7 v38 patches from the thread 
"SQL/JSON: functions".  These patches are preliminary for JSON_TABLE.

Patch 0002 only needs to be review in this thread.

v37 no longer applies so it requires a rebase, and also typedefs.list
was wrongly merged.
typedefs.list was fixed.

Please update.
Attached 38th version of the patches.


-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

0001-SQLJSON-functions-v38.patch.gz (183K) Download Attachment
0002-JSON_TABLE-v38.patch.gz (38K) Download Attachment
12