Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix(hive): Fix regression from apache#21943 (apache#22431)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Jan 17, 2023
1 parent d2ae204 commit 422c233
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions superset/db_engine_specs/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,23 @@ def _get_hive_type(dtype: np.dtype) -> str:
) as file:
pq.write_table(pa.Table.from_pandas(df), where=file.name)

engine.execute(
text(
f"""
CREATE TABLE {str(table)} ({schema_definition})
STORED AS PARQUET
LOCATION :location
"""
),
location=upload_to_s3(
filename=file.name,
upload_prefix=current_app.config[
"CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC"
](database, g.user, table.schema),
table=table,
),
)
with cls.get_engine(database) 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=current_app.config[
"CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC"
](database, g.user, table.schema),
table=table,
),
)

@classmethod
def convert_dttm(
Expand Down

0 comments on commit 422c233

Please sign in to comment.