-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[hive-csv] specify hive namespace for tables #5268
Conversation
superset/config.py
Outdated
@@ -314,6 +314,10 @@ class CeleryConfig(object): | |||
# contain all the external tables | |||
CSV_TO_HIVE_UPLOAD_DIRECTORY = 'EXTERNAL_HIVE_TABLES/' | |||
|
|||
# The namespace within hive where the tables created from | |||
# uploading CSVs will be stored | |||
UPLOADED_CSV_HIVE_NAMESPACE = 'superset' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new default changes the existing behvaior. You may want to considering setting this as None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops!
superset/db_engine_specs.py
Outdated
if config.get('UPLOADED_CSV_HIVE_NAMESPACE'): | ||
if '.' in table_name: | ||
raise Exception( | ||
"""You can't specify a namespace. """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you’re going to use “”” which reprsents a multiline string then make the string multiline. It’s probably more desirable to use single quoted strings and wrap either via \ or encapsulate in ().
0985bc9
to
7786852
Compare
Codecov Report
@@ Coverage Diff @@
## master #5268 +/- ##
==========================================
- Coverage 63.29% 63.28% -0.02%
==========================================
Files 259 259
Lines 19693 19698 +5
Branches 1968 1968
==========================================
+ Hits 12465 12466 +1
- Misses 7219 7223 +4
Partials 9 9
Continue to review full report at Codecov.
|
superset/db_engine_specs.py
Outdated
if config.get('UPLOADED_CSV_HIVE_NAMESPACE'): | ||
if '.' in table_name: | ||
raise Exception( | ||
"You can't specify a namespace." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. We need a space after the period.
superset/db_engine_specs.py
Outdated
if '.' in table_name: | ||
raise Exception( | ||
"You can't specify a namespace." | ||
'All tables will be uploaded to the `{}` namespace'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably use '
rather than a backtick here.
7786852
to
bf8a246
Compare
(cherry picked from commit bd24f85)
(cherry picked from commit bd24f85)
Cherrypick csv upload changes (apache#5268)
This PR gives the administrators the option of forcing uploaded CSVs into a specific namespace in Hive.
@john-bodley @mistercrunch
cc @paulbramsen