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

datahub-lite Catalog Error: An index with the name aspect_idxalready exists! #10227

Closed
nsouch opened this issue Apr 7, 2024 · 2 comments · Fixed by #10267
Closed

datahub-lite Catalog Error: An index with the name aspect_idxalready exists! #10227

nsouch opened this issue Apr 7, 2024 · 2 comments · Fixed by #10267
Assignees
Labels
bug Bug report

Comments

@nsouch
Copy link

nsouch commented Apr 7, 2024

Describe the bug
Using the datahub-lite REST API, any query results in a duckdb.duckdb.CatalogException.

To Reproduce
Steps to reproduce the behavior:

  1. Launch "datahub lite serve"
  2. Open http://127.0.0.1:8979
  3. Execute GET entities request

Expected behavior
The above should return the list of entities but returns an HTTP 500 (see hereunder exception details).

I observed in code that the pre-existence of the index should be softly handled in DuckDBLite class:

    self.duckdb_client.execute(
        "CREATE UNIQUE INDEX IF NOT EXISTS aspect_idx ON metadata_aspect_v2 (urn, aspect_name, version)"
    )

I noticed in DuckDB documentation that "IF NOT EXISTS" syntax is not mentioned though (see https://duckdb.org/docs/sql/statements/create_index.html)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge
  • Version: acryl-datahub-0.13.1.2, duckdb-0.10.1

Additional context

  File "c:\users\<user>\documents\gitlab\dth00\bin\python38\lib\site-packages\datahub\lite\lite_server.py", line 32, in lite
	lite = _get_datahub_lite()
  File "c:\users\<user>\documents\gitlab\dth00\bin\python38\lib\site-packages\datahub\cli\lite_cli.py", line 58, in _get_datahub_lite
	duckdb_lite = get_datahub_lite(config_dict=lite_config.dict(), read_only=read_only)
  File "c:\users\<user>\documents\gitlab\dth00\bin\python38\lib\site-packages\datahub\lite\lite_util.py", line 107, in get_datahub_lite
	lite = lite_class(lite_specific_config)
  File "c:\users\<user>\documents\gitlab\dth00\bin\python38\lib\site-packages\datahub\lite\duckdb_lite.py", line 56, in __init__
	self._init_db()
  File "c:\users\<user>\documents\gitlab\dth00\bin\python38\lib\site-packages\datahub\lite\duckdb_lite.py", line 63, in _init_db
	self.duckdb_client.execute(
  duckdb.duckdb.CatalogException: Catalog Error: An index with the name aspect_idxalready exists!
@nsouch nsouch added the bug Bug report label Apr 7, 2024
@hsheth2 hsheth2 self-assigned this Apr 8, 2024
@hsheth2
Copy link
Collaborator

hsheth2 commented Apr 8, 2024

@nsouch nice catch - is this something you'd be willing to create a PR for? Happy to provide guidance there :)

@jonasHanhan
Copy link
Contributor

I'm willing to do it if it's inconvenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants