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

[hive-csv] specify hive namespace for tables #5268

Merged
merged 1 commit into from Jun 25, 2018

Conversation

timifasubaa
Copy link
Contributor

This PR gives the administrators the option of forcing uploaded CSVs into a specific namespace in Hive.

@john-bodley @mistercrunch
cc @paulbramsen

@@ -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'
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

if config.get('UPLOADED_CSV_HIVE_NAMESPACE'):
if '.' in table_name:
raise Exception(
"""You can't specify a namespace. """
Copy link
Member

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 ().

@timifasubaa timifasubaa force-pushed the specify_hive_namespace branch 3 times, most recently from 0985bc9 to 7786852 Compare June 22, 2018 17:36
@codecov-io
Copy link

codecov-io commented Jun 22, 2018

Codecov Report

Merging #5268 into master will decrease coverage by 0.01%.
The diff coverage is 20%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
superset/db_engine_specs.py 53.51% <0%> (-0.36%) ⬇️
superset/config.py 92.36% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca5cc67...bf8a246. Read the comment docs.

if config.get('UPLOADED_CSV_HIVE_NAMESPACE'):
if '.' in table_name:
raise Exception(
"You can't specify a namespace."
Copy link
Member

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.

if '.' in table_name:
raise Exception(
"You can't specify a namespace."
'All tables will be uploaded to the `{}` namespace'.format(
Copy link
Member

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.

@timifasubaa timifasubaa merged commit bd24f85 into apache:master Jun 25, 2018
mistercrunch pushed a commit that referenced this pull request Jun 28, 2018
timifasubaa added a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
timifasubaa added a commit to airbnb/superset-fork that referenced this pull request Sep 19, 2018
graceguo-supercat pushed a commit to airbnb/superset-fork that referenced this pull request Sep 19, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🍒 0.26.0 🍒 0.26.1 🍒 0.26.2 🍒 0.26.3 🍒 0.27.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🍒 0.26.0 🍒 0.26.1 🍒 0.26.2 🍒 0.26.3 🍒 0.27.0 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants