Skip to content

Commit

Permalink
fix gather table dump (#352)
Browse files Browse the repository at this point in the history
fix gather table dump
  • Loading branch information
Teingi authored Jul 22, 2024
1 parent 14adaf1 commit abe2afe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions handler/gather/gather_tabledump.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def execute(self):

def __get_table_schema(self):
try:
self.table = self.__extract_table_name(self.table)
sql = "show create table " + self.database + "." + self.table
columns, result = self.tenant_connector.execute_sql_return_columns_and_data(sql)
if result is None or len(result) == 0:
Expand Down Expand Up @@ -237,6 +238,13 @@ def __extract_string(self, s):
else:
return s

def __extract_table_name(self, full_name):
parts = full_name.split('.')
if len(parts) > 1:
return parts[-1]
else:
return full_name

def __print_result(self):
self.end_time = time.time()
elapsed_time = self.end_time - self.start_time
Expand Down

0 comments on commit abe2afe

Please sign in to comment.