-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What happens?
JSON values are exported or returned in queries in an incorrect simil-JSON format which makes it difficult to use when using clients, or impossible to export tables to json format.
Briefly the returned format encloses keys in single quotes (instead of double quotes) and completely removes quotes from string values made of alphanumeric characters.
I expect a JSON field to return properly formatted JSON when querying.
To Reproduce
INSTALL json;
LOAD json;
CREATE TABLE test (a JSON);
INSERT INTO test (a) VALUES ({'a': 'bc', 'd': 3.0 });
COPY test TO 'entries.json' (DELIMITER ',');
outputs Error: Invalid Input Error: Malformed JSON at byte 1 of input: unexpected character. Input: {'a': bc, 'd': 3.0}
.
Analogously, when querying from the Python client, the returned data is difficult to parse, as the format is a non-standard one.
OS:
Linux x64 (Fedora 36)
DuckDB Version:
v0.7.2-dev1034 18142dc
DuckDB Client:
CLI
Full Name:
Dario Balboni
Affiliation:
Scuola Normale Superiore (University)
Have you tried this on the latest master
branch?
- I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- I agree