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

Table auto complete fails when a Glue table name has a "." in its name #67

Closed
nadavaviv opened this issue Dec 1, 2020 · 4 comments
Closed

Comments

@nadavaviv
Copy link

Hi, I have a glue table named "example.example".
When I'm using the Database and try to select * from , the auto completion fails, and the following error message is displayed:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/opt/conda/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.7/site-packages/athenacli/completion_refresher.py", line 71, in _bg_refresh
    refresher(completer, executor)
  File "/opt/conda/lib/python3.7/site-packages/athenacli/completion_refresher.py", line 113, in refresh_tables
    completer.extend_columns(executor.table_columns(), kind='tables')
  File "/opt/conda/lib/python3.7/site-packages/athenacli/completer.py", line 124, in extend_columns
    metadata[self.dbname][relname].append(column)
KeyError: '"example.example"'

Is this a known issue?

@zzl0
Copy link
Contributor

zzl0 commented Dec 6, 2020

Thanks for the feedback. I'm sorry I am not sure how to reproduce it, could you share the schema of your example database? or provide us the steps to reproduce this issue?

@nadavaviv
Copy link
Author

nadavaviv commented Dec 16, 2020

Basically I've just created a table which has a . in its name.
Once I've edited the name and replaced the . with an _, everything worked just fine

Edit: Just noticed, the name of the Database isn't example, it's something else.
The name of the table itself is example.example.

@zzl0
Copy link
Contributor

zzl0 commented Dec 17, 2020

I see, thanks for the explanation, I will take a look this on weekend.

@zzl0
Copy link
Contributor

zzl0 commented Dec 20, 2020

Checked the Athena document, it's a known limitation of Athena.

Special characters other than underscore (_) are not supported. For more information, 
see the Apache Hive LanguageManual DDL documentation.

Important
Although you may succeed in creating table, view, database, or column names that contain
special characters other than underscore by enclosing them in backtick (`) characters,
subsequent DDL or DML queries that reference them can fail.

https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html

@zzl0 zzl0 closed this as completed Dec 20, 2020
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

2 participants