SameerMesiah97 commented on code in PR #66658:
URL: https://github.com/apache/airflow/pull/66658#discussion_r3221593970
##########
providers/elasticsearch/src/airflow/providers/elasticsearch/hooks/elasticsearch.py:
##########
@@ -99,7 +106,29 @@ def fetchone(self):
return None
def fetchmany(self, size: int | None = None):
- raise NotImplementedError()
+ size = size or self.body["fetch_size"]
+
+ results: list[list[Any]] = []
+
+ while len(results) < size:
+ # Consume rows from the current page buffer before
+ # requesting additional cursor pages from Elasticsearch.
+ if self._rows:
+ remaining = size - len(results)
+
+ results.extend(self._rows[:remaining])
+
+ self._rows = self._rows[remaining:]
+
+ if len(results) >= size:
+ break
+
+ if not self.cursor:
+ break
+
+ self.execute(statement=self.body["query"])
Review Comment:
When the cursor is present, `execute` now just sends that in the response
payload instead of all of the parameters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]