You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/06/22 06:16:01 UTC

[GitHub] hughhhh commented on a change in pull request #5267: [hive-csv] Infer schema from csv

hughhhh commented on a change in pull request #5267: [hive-csv] Infer schema from csv
URL: https://github.com/apache/incubator-superset/pull/5267#discussion_r197349573
 
 

 ##########
 File path: superset/db_engine_specs.py
 ##########
 @@ -973,12 +974,15 @@ 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
+        def convert_to_hive_type(col_type):
+            """maps tableschema's types to hive types"""
+            if col_type == "number":
 
 Review comment:
   I think having a dict for the mapping would be cleaner also would allow for people to easily add more types if need be.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org