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

bug: create table in a database that does not exist fails results in an unclear error message #1219

Closed
1 of 2 tasks
gaurav274 opened this issue Sep 26, 2023 · 0 comments · Fixed by #1223
Closed
1 of 2 tasks

Comments

@gaurav274
Copy link
Member

gaurav274 commented Sep 26, 2023

Search before asking

  • I have searched the EvaDB issues and found no similar bug report.

Bug

cursor.query(
            """ CREATE DATABASE sqlite_data WITH ENGINE = 'sqlite', 
                PARAMETERS = {"database": "stargazers.db"};"""
        )

print(
            cursor.query(
                f"""
           CREATE TABLE IF NOT EXISTS sqlite_data.{repo_name}_StargazerList AS
           SELECT GithubStargazers("{repo_url}", "{github_pat}");
        """
            ).df()
        )
09-26-2023 01:57:23 ERROR [native_storage_engine:native_storage_engine.py:create:0120] Failed to create the table StargazerList in data source sqlite_data with exception 'NoneType' object has no attribute 'engine'
Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/storage/native_storage_engine.py", line 113, in create
    db_catalog_entry.engine, **db_catalog_entry.params
AttributeError: 'NoneType' object has no attribute 'engine'
09-26-2023 01:57:23 ERROR [table_catalog_service:table_catalog_service.py:delete_entry:0118] Delete table failed for TableCatalogEntry(name='StargazerList', file_url=None, table_type=<TableType.NATIVE_DATA: 7>, identifier_column='id', columns=[ColumnCatalogEntry(name='github_username', type=<ColumnType.NDARRAY: 5>, is_nullable=False, array_type=<NdArrayType.STR: 11>, array_dimensions=(None,), table_id=None, table_name=None, row_id=None, dep_caches=[])], row_id=None, database_name='sqlite_data') with error 'NoneType' object has no attribute 'delete'.
Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/storage/native_storage_engine.py", line 113, in create
    db_catalog_entry.engine, **db_catalog_entry.params
AttributeError: 'NoneType' object has no attribute 'engine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/executor/create_executor.py", line 58, in exec
    storage_engine.create(table=catalog_entry)
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/storage/native_storage_engine.py", line 121, in create
    raise Exception(err_msg)
Exception: Failed to create the table StargazerList in data source sqlite_data with exception 'NoneType' object has no attribute 'engine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/catalog/services/table_catalog_service.py", line 114, in delete_entry
    table_obj.delete(self.session)
AttributeError: 'NoneType' object has no attribute 'delete'
09-26-2023 01:57:23 ERROR [plan_executor:plan_executor.py:execute_plan:0186] Failed to create the table StargazerList in data source sqlite_data with exception 'NoneType' object has no attribute 'engine'
Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/storage/native_storage_engine.py", line 113, in create
    db_catalog_entry.engine, **db_catalog_entry.params
AttributeError: 'NoneType' object has no attribute 'engine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/executor/plan_executor.py", line 180, in execute_plan
    output = execution_tree.exec()
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/executor/create_executor.py", line 79, in exec
    raise e
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/executor/create_executor.py", line 58, in exec
    storage_engine.create(table=catalog_entry)
  File "/home/gkakkar7/VAST/evadb/evadb_310/lib/python3.10/site-packages/evadb/storage/native_storage_engine.py", line 121, in create
    raise Exception(err_msg)
Exception: Failed to create the table StargazerList in data source sqlite_data with exception 'NoneType' object has no attribute 'engine'
❗️ EvaDB Session ended with an error: Failed to create the table StargazerList in data source sqlite_data with exception 'NoneType' object has no attribute 'engine'

Environment

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@gaurav274 gaurav274 linked a pull request Sep 26, 2023 that will close this issue
xzdandy added a commit that referenced this issue Sep 27, 2023
1. `IF NOT EXISTS` support added for native databases.
2. Better error messaging for #1219

---------

Co-authored-by: Jiashen Cao <[email protected]>
Co-authored-by: Andy Xu <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant