fix(hive): Fix regression from #21943 (#22431)

This commit is contained in:
John Bodley
2022-12-16 09:28:50 +13:00
committed by GitHub
parent fa919f3d8c
commit 4f9c2c8165

View File

@@ -225,22 +225,23 @@ class HiveEngineSpec(PrestoEngineSpec):
) 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(