john-bodley commented on a change in pull request #5267: [hive-csv] Infer
schema from csv
URL:
https://github.com/apache/incubator-superset/pull/5267#discussion_r197596359
##########
File path: superset/db_engine_specs.py
##########
@@ -973,28 +973,37 @@ def fetch_data(cls, cursor, limit):
@staticmethod
def create_table_from_csv(form, table):
"""Uploads a csv file and creates a superset datasource in Hive."""
- def get_column_names(filepath):
- with open(filepath, 'rb') as f:
- return next(unicodecsv.reader(f, encoding='utf-8-sig'))
-
- table_name = form.name.data
- filename = form.csv_file.data.filename
-
- bucket_path = app.config['CSV_TO_HIVE_UPLOAD_S3_BUCKET']
+ def convert_to_hive_type(col_type):
+ """maps tableschema's types to hive types"""
+ TABLESCHEMA_TO_HIVE_TYPES = {
Review comment:
Sorry given this no longer resides in the config this should be a lower case
variable name.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]