Presto: Column '"data"' cannot be resolved for jsonb

Created on 14 Nov 2016  路  5Comments  路  Source: prestodb/presto

created a jsonb table in postgres db and trying to query it from presto and its showing below error.

in postgresdb:
CREATE TABLE json_test (
id serial primary key,
data jsonb
);

INSERT INTO json_test (data) VALUES
('{}'),
('{"a": 1}'),
('{"a": 2, "b": ["c", "d"]}'),
('{"a": 1, "b": {"c": "d", "e": true}}'),
('{"b": 2}');

SELECT * FROM json_test;

in presto

presto:public> SELECT * FROM json_test;

id

1
2
3
4
5
(5 rows)

Query 20161114_162548_00003_9fxak, FINISHED, 2 nodes
Splits: 2 total, 2 done (100.00%)
0:00 [5 rows, 0B] [53 rows/s, 0B/s]

presto:public> SELECT * FROM json_test WHERE data = '{"a":1}';
Query 20161114_162602_00004_9fxak failed: line 1:31: Column '"data"' cannot be resolved
SELECT * FROM json_test WHERE data = '{"a":1}'

presto:public> SELECT * FROM json_test WHERE data = '{"a":1}';
Query 20161114_162933_00006_9fxak failed: line 1:31: Column '"data"' cannot be resolved
SELECT * FROM json_test WHERE data = '{"a":1}'

Most helpful comment

JSONB in Postgres is so common these days that I'm surprised this hasn't been implemented yet.

All 5 comments

JSONB in Postgres is so common these days that I'm surprised this hasn't been implemented yet.

We are eagerly waiting for this feature. Any idea on when will it be released?

Presto is an open source project. Do you want to help contribute this feature? Thanks!

Relax, hacktoberfest contributors are coming to the rescue 馃槃

Hi, looks like this was fixed in a recent version of presto: https://prestosql.io. It's been working for us.

Was this page helpful?
0 / 5 - 0 ratings