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

catalog exception when trying to run read_json_objects after loading json module #4954

Closed
2 tasks done
raam86 opened this issue Oct 11, 2022 · 4 comments
Closed
2 tasks done
Labels

Comments

@raam86
Copy link

raam86 commented Oct 11, 2022

What happens?

running

con = duckdb.connect(database=':memory:')
con.execute("INSTALL json; LOAD json;select read_json_objects('./testjson.json')").fetchall()

results in

CatalogException: Catalog Error: Function with name read_ndjson_objects is not on the catalog, but it exists in the json extension. To Install and Load the extension, run: INSTALL json; LOAD json;

To Reproduce

install latest duckdb and run the above command.

on master json extension isn't available.

OS:

osx

DuckDB Version:

5.0.1

DuckDB Client:

Python

Full Name:

Raam Roch Hai

Affiliation:

etixoo

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
@Mytherin
Copy link
Collaborator

read_json_objects is a table function, as such it needs to be used in the FROM clause:

select * from read_json_objects('./testjson.json')

The error message is confusing, we should probably store the function type alongside the function name so we can improve the error message.

@Tishj
Copy link
Contributor

Tishj commented Jun 9, 2023

@lnkuiper is this still a problem?

@Tishj Tishj assigned Tishj and unassigned Tishj Jun 9, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Sep 8, 2023
@lnkuiper
Copy link
Contributor

lnkuiper commented Sep 8, 2023

This is no longer a problem, we now throw a descriptive error:

D select read_json('');
-- Error: Binder Error: Function "read_json" is a table function but it was used as a scalar function. This function has to be called in a FROM clause (similar to a table).
-- LINE 1: select read_json('');

@lnkuiper lnkuiper closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants