Skip to content

Commit

Permalink
fix(hive): Fix regression from #21943 (#22431)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored Dec 15, 2022
1 parent fa919f3 commit 4f9c2c8
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 4f9c2c8

Please sign in to comment.