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

Commit

Permalink
skip test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Heisterkamp committed Nov 10, 2022
1 parent 8da4438 commit 3864b27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/atc/delta/delta_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def append(self, df: DataFrame, mergeSchema: bool = None) -> None:
return self.write_or_append(df, "append", mergeSchema=mergeSchema)

def truncate(self) -> None:
if self._path:
Spark.get().sql(f"TRUNCATE TABLE delta.`{self._path}`;")
if self._location:
Spark.get().sql(f"TRUNCATE TABLE delta.`{self._location}`;")
else:
Spark.get().sql(f"TRUNCATE TABLE {self._name};")
# if the name also does not exit, this will give a useful error like
# if the hive table does not exit, this will give a useful error like
# pyspark.sql.utils.AnalysisException:
# Table not found for 'TRUNCATE TABLE': TestDb.TestTbl;

Expand Down
13 changes: 12 additions & 1 deletion tests/cluster/delta/test_delta_class.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import time
import unittest

from pyspark.sql.utils import AnalysisException
Expand Down Expand Up @@ -84,7 +85,17 @@ def test_03_create(self):
db.create()

dh = DeltaHandle.from_tc("MyTbl")
dh.create_hive_table()
for i in range(10, 0, -1):
try:
dh.create_hive_table()
break
except AnalysisException as e:
if i > 0:
print(e)
print("trying again in 10 seconds")
time.sleep(10)
else:
raise e

# test hive access:
df = Spark.get().table("TestDb.TestTbl")
Expand Down

0 comments on commit 3864b27

Please sign in to comment.