-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON + JSONB operators ->
and ->>
pushing down implementation in WHERE
+ new SQLite err codes
#109
base: master
Are you sure you want to change the base?
Conversation
Hello, pgspider team! There is some JSON support problem in CI. Could anyone diagnose?
|
SQLite version on CI is 3.46.0. |
@lamdn1409 , thanks for proposition, but bc7515d unfortunately gives no result. Maybe we don't know something about compilation in CI environtment. |
@lamdn1409 , I am still cannot explain the bad result. In the log there is |
@lamdn1409, in CI was problem of SQLite install: usual library directory is |
@lamdn1409 , please look at the state after ef6cae1 : here is no SQLite downloading, bull all tests except json are successfully! Hence SQLite downloading in CI is absolutely not effective for the environment. |
@lamdn1409 , now there are successfully tests, please review a code. |
@mkgrgis sorry for late reply, I had a long vacation. |
I had too :-) My congratulations!
CI SQLite compilation script is not effective in complex with FDW compilation. There was wrong |
Ping, @lamdn1409 ? |
@mkgrgis Thanks for your information. I understood the root cause. However, I concern about the downloaded SQLite version maybe not used yet. I'm thinking about 02 solutions:
|
I prefer the second variant, @lamdn1409:
But I don't think this is a subject of this PR. |
me, too. However, let me discuss with our members first.
I think so, we need to separate this issue. Unfortunately, we cannot spend time to solve the issue at the moment. Could you please support to solve it? |
@lamdn1409 , let's continue review of the code in this PR.
No problems. This planned after pure_float fix and schemas support PR, but before returning to I think here is something about |
Thank you. Your plan is OK. |
I finished reviewing the PR. Please confirm my comments. |
Where are this comments @lamdn1409 ? Could you please give URL because I don't see anything here? |
@lamdn1409 , SQLite compilation autonomy was successfully used in current CI state. Do you think #112 can be closed now? |
->
and ->>
pushing down implementation in WHERE
+ new SQLite err codes
@mkgrgis Please create a PR for reviewing, it's other issue. |
@lamdn1409 , this problem was detected and resolved in this PR. Currently all tests use not system, but compiled and downloaded SQLite library. You can ensure this. CI Ubuntu is old, but SQLite is more newer. |
@mkgrgis It's OK for me. I will review the changes about CI. |
This is about #109 (comment). In this PR we cannot implement full SQLite |
This is about #109 (comment). In this PR we cannot implement full SQLite |
->
and ->>
pushing down implementation in WHERE
+ new SQLite err codes->
and ->>
pushing down implementation in WHERE
+ new SQLite err codes
@lamdn1409 , FYI about SQLite JSONB an SQLite official software engineer Stephan Beal thinks we should use SQL |
@lamdn1409 , full SQLite JSONB support was implemented. I think TC 015 confirm binding without errors for a group of values. The solution is based on in-memory read-only SQLite connection where |
@lamdn1409 , are any problems in PR now? |
@mkgrgis How about this issue #109 (comment)? |
I need some help with Datum
sqlite_fdw_sqlite_version(PG_FUNCTION_ARGS)
{
PG_RETURN_INT32(SQLITE_VERSION_NUMBER);
} with CREATE OR REPLACE FUNCTION sqlite_fdw_sqlite_version()
RETURNS int
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
COMMENT ON FUNCTION sqlite_fdw_sqlite_version()
IS 'Returns used SQLite code version'; |
@mkgrgis I can get correct SQLite version with this modification on Makefile. Could you try it?
My system SQLite still be 3.49.0
Please note that sqlite3 in test.sh should be changed accordingly.
|
Thanks, @lamdn1409 , I am beginning this experiment. Please look at my new test |
@lamdn1409 , please look at current results. I think SQLite install process is successfully, we have normal
but
and no JSON functions. Maybe we have different library and header? See https://sqlite.org/c3ref/libversion.html assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); |
@lamdn1409 , separate SQLite version for testing problem was resolved! ifdef SQLITE_FOR_TESTING_DIR
SHLIB_LINK := -L$(SQLITE_FOR_TESTING_DIR)/lib -lsqlite3
PG_CFLAGS += -I$(SQLITE_FOR_TESTING_DIR)/include -Wl,-rpath,$(SQLITE_FOR_TESTING_DIR)/lib
else
SHLIB_LINK := -lsqlite3
endif Please note additional |
…ite err codes
It's great the issue was resolved. Congratulations.
|
This parameter allows us to use (on linking |
I got it. Thanks for explanation. |
Thanks, @lamdn1409 for the great work! I was happy to work with you around of this PR. SQLite JSONB was really unexpected for me, but we was able to ensure full support of this data structure in the PR. |
@t-kataym , could you please give some approximate dates of this PR review? I am having rebased drafts for other PRs, but some little changes after you review are still possible. |
In this PR about JSON operators support
->
and->>
operators for left both JSON and JSONB operand inWHERE
clauses for both string and integer arguments. Based on https://sqlite.org/json1.htmltypes/json
test case set showing->
and->>
behaviour for both JSON and JSONB for bothSELECT
andWHERE
usage contextsjsonb
support.auto_import
test forFOREIGN IMPORT SCHEMA
behaviour. This test have versions with GIS support and without GIS support.||
andsubstr
pushing down in tests.sqlite_fdw_sqlite_version()
andsqlite_fdw_sqlite_code_source()
SQL functions.Motivation: osmium OSM→PostGIS tool generates OSM tags as JSON or JSONB data. Typical usage look like
... WHERE t->>'building' IS NOT NULL
or ...WHERE t->>'access' = 'private'
.