pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Erik Rijkers <er@xs4all.nl>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: David Steele <david@pgmasters.net>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Oleg Bartunov <obartunov@gmail.com>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Subject: Re: SQL/JSON: JSON_TABLE
Date: Tue, 30 Mar 2021 23:25:10 +0300
Message-ID: <69eefc5a-cabc-8dd3-c689-93da038c0d6a@postgrespro.ru> (raw)
In-Reply-To: <2101814418.20240.1617123418368@webmailclassic.xs4all.nl>
References: <CAFj8pRAyMkNDJ=aGQFw2eai=FA6tr-asv2-dvUhveq=Ek5Vk8w@mail.gmail.com>
	<CAFj8pRCCyACYVA4DHCNVTQteRrWmE_BiPGKdWJfiN3i0jj0TjQ@mail.gmail.com>
	<df16e6d8-4de6-f228-5109-60aefed5d180@postgrespro.ru>
	<CAFj8pRBaSA06w9WzG52Qu7r10MT2Qxd9Pzg0bbiZCCS_QKhgkg@mail.gmail.com>
	<CAFj8pRC8MU2VxY=zYMnG1haM=pfvrRMYJfpt+-C2ACG1L4QdOQ@mail.gmail.com>
	<bfcb411e-8dab-1fae-ed22-2aebaf584a5f@postgrespro.ru>
	<20200705171558.GP4107@telsasoft.com>
	<20200803075558.GQ3317@paquier.xyz>
	<7e2cb85d-24cf-4abb-30a5-1a33715959bd@postgrespro.ru>
	<CALNJ-vTXxYOy9baMhFRQH9S5KUkuy8UfO4EpjQv77H7ymcN6nA@mail.gmail.com>
	<cf448269-f62f-b0ac-14d0-1972ac3a8c3a@postgrespro.ru>
	<775a7d16-481c-978f-a6cf-29604a38102b@pgmasters.net>
	<dacf209e-b098-41bf-2d1c-4cf6e64ad511@dunslane.net>
	<1238462749.310979.1616791680679@webmailclassic.xs4all.nl>
	<f51e6af8-b607-dae4-44e8-54a89de009bd@dunslane.net>
	<2d8dcd2f-fe6e-bf31-a21a-90a843edfafc@postgrespro.ru>
	<2101814418.20240.1617123418368@webmailclassic.xs4all.nl>

On 30.03.2021 19:56, Erik Rijkers wrote:

>> On 2021.03.27. 02:12 Nikita Glukhov <n.gluhov@postgrespro.ru> wrote:
>>
>> Attached 47th version of the patches.
> Hi,
>
> Apply, build all fine.  It also works quite well, and according to specification, as far as I can tell.
>
> But today I ran into:
>
> ERROR:  function ExecEvalJson not in llvmjit_types.c
>
> I think that it is caused by:
>
> set enable_bitmapscan = off;
>
> (I installed llvm a few days ago. llvm-3.9-dev on this debian stretch).
>
>
> This is the test sql I concocted, which runs fine with enable_bitmapscan on (the default):
>
> select jt1.*
> from myjsonfile100k as t(js, id)
>    , json_table(
>        t.js
>     , '$' columns (
>          "lastname"   text    path  '$. "lastname"     '
>        , "firstname"  text    path  '$. "firstname"    '
>        , "date"       text    path  '$. "date"         '
>        , "city"       text    path  '$. "city"         '
>        , "country"    text    path  '$. "country"      '
>        , "name 0(1)"  text    path  '$. "array"[0]     '
>        , "name 4(5)"  text    path  '$. "array"[4]     '
>        , "names"      text[]  path  '$. "array"        '
>        , "randfloat"  float   path  '$. "random float" '
>      )
> ) as jt1
> where  js @> ('[ { "city": "Santiago de Cuba" } ]')
>     and js[0]->>'firstname' = 'Gilda'
> ;
> ERROR:  function ExecEvalJson not in llvmjit_types.c
>
> That statement only errors out if the table is large enough. I have no time now to make a sample table but if no-one understands the problem off-hand, I'll try to construct such a table later this week (the one I'm using is large, 1.5 GB).

Thank you for testing.


I think you can try to add 3 missing functions references to the end of
src/backend/jit/llvm/llvmjit_types.c:

  void       *referenced_functions[] =
  {
      ...
      ExecEvalXmlExpr,
+    ExecEvalJsonConstructor,
+    ExecEvalIsJsonPredicate,
+    ExecEvalJson,
      MakeExpandedObjectReadOnlyInternal,
      ...
  };


If this fixes problem, I will add this to the new version of the patches.


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

view thread (98+ messages)  latest in thread

Message-ID: <69eefc5a-cabc-8dd3-c689-93da038c0d6a@postgrespro.ru>
Permalink:  ../69eefc5a-cabc-8dd3-c689-93da038c0d6a@postgrespro.ru/
Also on:    postgresql.org/message-id/69eefc5a-cabc-8dd3-c689-93da038c0d6a@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: n.gluhov@postgrespro.ru, er@xs4all.nl, andrew@dunslane.net, david@pgmasters.net, michael@paquier.xyz, pryzby@telsasoft.com, pavel.stehule@gmail.com, robertmhaas@gmail.com, 9erthalion6@gmail.com, obartunov@gmail.com, andrew.dunstan@2ndquadrant.com, zyu@yugabyte.com
  Subject: Re: SQL/JSON: JSON_TABLE
  In-Reply-To: <69eefc5a-cabc-8dd3-c689-93da038c0d6a@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox