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:09:17 UTC

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

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



##########
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:
       good point, I would suggest to use params for this one: https://docs.sqlalchemy.org/en/13/core/connections.html#sqlalchemy.engine.Engine.execute




----------------------------------------------------------------
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