Skip to content

Commit

Permalink
Optimize the query task and do not execute it when there is no data w…
Browse files Browse the repository at this point in the history
…hen executing reduce
  • Loading branch information
snower committed Mar 20, 2024
1 parent 5d47f79 commit 6448932
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions syncanysql/taskers/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def __init__(self, executor, session_config, manager, arguments, tasker, config,
self.batch_count = 0

def outputed(self, tasker, datas):
if not datas:
return
if self.batch > 0 and self.count > 0 and self.count + len(datas) >= self.batch:
self.count, self.batch_count = 0, 1
self.tasker.run_reduce(self.executor, self.session_config, self.manager, self.arguments, False)
Expand Down

0 comments on commit 6448932

Please sign in to comment.