Skip to content
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 Overview COPY example raises "Invalid Input Error" #4530

Open
ruslandoga opened this issue Jan 9, 2025 · 0 comments
Open

JSON Overview COPY example raises "Invalid Input Error" #4530

ruslandoga opened this issue Jan 9, 2025 · 0 comments

Comments

@ruslandoga
Copy link

ruslandoga commented Jan 9, 2025

👋

This issue is regarding https://duckdb.org/docs/data/json/overview

Running

CREATE TABLE todos (userId UBIGINT, id UBIGINT, title VARCHAR, completed BOOLEAN);
COPY todos FROM 'todos.json';

on https://duckdb.org/data/json/todos.json raises

Invalid Input Error: Malformed JSON in file "todos.json", at byte 2 in line 2: unexpected end of data. Try auto-detecting the JSON format

Using read_json outside of COPY works.


Repro:

$ curl https://duckdb.org/data/json/todos.json -O

$ head todos.json 
[
  {
    "userId": 1,
    "id": 1,
    "title": "delectus aut autem",
    "completed": false
  },
  {
    "userId": 1,
    "id": 2,

$ duckdb --version
v1.1.3 19864453f7

$ duckdb
CREATE TABLE todos (userId UBIGINT, id UBIGINT, title VARCHAR, completed BOOLEAN);
COPY todos FROM 'todos.json';
-- Invalid Input Error: Malformed JSON in file "todos.json", at byte 2 in line 2: unexpected end of data. Try auto-detecting the JSON format

-- but
select count(*) from 'todos.json';
-- ┌──────────────┐
-- │ count_star() │
-- │    int64     │
-- ├──────────────┤
-- │          200 │
-- └──────────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant