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 2020/06/03 02:00:44 UTC

[GitHub] [incubator-superset] serenajiang commented on a change in pull request #9971: [csv upload][hive] support other delimiters

serenajiang commented on a change in pull request #9971:
URL: https://github.com/apache/incubator-superset/pull/9971#discussion_r434267620



##########
File path: superset/db_engine_specs/hive.py
##########
@@ -163,10 +163,11 @@ def convert_to_hive_type(col_type: str) -> str:
             bucket_path,
             os.path.join(upload_prefix, table.table, os.path.basename(filename)),
         )
-        # TODO(bkyryliuk): support other delimiters
+
         sql = f"""CREATE TABLE {str(table)} ( {schema_definition} )
-            ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS
-            TEXTFILE LOCATION '{location}'
+            ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe'
+            WITH SERDEPROPERTIES ("field.delim"="{csv_to_df_kwargs['sep']}")

Review comment:
       Yes, this code is really insecure, but aren't we all? Hahahahahahahaha




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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