hy144328 commented on code in PR #41917:
URL: https://github.com/apache/superset/pull/41917#discussion_r3563968029
##########
superset/db_engine_specs/hive.py:
##########
@@ -260,22 +261,23 @@ def _get_hive_type(dtype: np.dtype[Any]) -> str:
catalog=table.catalog,
schema=table.schema,
) as engine:
- engine.execute(
- text(
- f"""
- CREATE TABLE {str(table)} ({schema_definition})
- STORED AS PARQUET
- LOCATION :location
- """
- ),
- location=upload_to_s3(
- filename=file.name,
-
upload_prefix=app.config["CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC"](
- database, g.user, table.schema
+ with engine.begin() as conn:
+ conn.execute(
+ text(
+ f"""
+ CREATE TABLE {str(table)} ({schema_definition})
+ STORED AS PARQUET
+ LOCATION :location
+ """
),
- table=table,
- ),
- )
+ location=upload_to_s3(
+ filename=file.name,
+ upload_prefix=app.config[
+ "CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC"
+ ](database, g.user, table.schema),
+ table=table,
+ ),
+ )
Review Comment:
Done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]