You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which can be used in conjuction with a for-await...of. It handles automatically
542
542
the `429` error and uses the `maxRetries` option of the client.
543
543
544
544
[source,js]
@@ -576,7 +576,7 @@ for await (const result of scrollSearch) {
576
576
[discrete]
577
577
==== Quickly getting the documents
578
578
579
-
If you only need the documents from the result of a scroll search, you can
579
+
If you only need the documents from the result of a scroll search, you can
580
580
access them via `result.documents`:
581
581
582
582
[source,js]
@@ -593,9 +593,9 @@ for await (const result of scrollSearch) {
593
593
594
594
~Added~ ~in~ ~`v7.7.0`~
595
595
596
-
It works in the same way as the scroll search helper, but it returns only the
597
-
documents instead. Note, every loop cycle returns a single document, and you
598
-
can't use the `clear` method. For improving the performances, this helper
596
+
It works in the same way as the scroll search helper, but it returns only the
597
+
documents instead. Note, every loop cycle returns a single document, and you
598
+
can't use the `clear` method. For improving the performances, this helper
599
599
automatically adds `filter_path=hits.hits._source` to the query string.
600
600
601
601
[source,js]
@@ -707,3 +707,40 @@ const result = await client.helpers
707
707
.esql({ query: 'FROM sample_data | LIMIT 2' })
708
708
.toRecords<EventLog>()
709
709
----
710
+
711
+
[discrete]
712
+
===== `toArrowReader`
713
+
714
+
~Added~ ~in~ ~`v8.16.0`~
715
+
716
+
ES|QL can return results in multiple binary formats, including https://arrow.apache.org/[Apache Arrow]'s streaming format. Because it is a very efficient format to read, it can be valuable for performing high-performance in-memory analytics. And, because the response is streamed as batches of records, it can be used to produce aggregations and other calculations on larger-than-memory data sets.
717
+
718
+
`toArrowReader` returns a https://arrow.apache.org/docs/js/classes/Arrow_dom.RecordBatchReader.html[`RecordBatchStreamReader`].
719
+
720
+
[source,ts]
721
+
----
722
+
const reader = await client.helpers
723
+
.esql({ query: 'FROM sample_data' })
724
+
.toArrowReader()
725
+
726
+
for (let recordBatch of reader) {
727
+
// prints the first record in each record batch as JSON
728
+
console.log(recordBatch.get(0).toJSON())
729
+
}
730
+
----
731
+
732
+
[discrete]
733
+
===== `toArrowTable`
734
+
735
+
~Added~ ~in~ ~`v8.16.0`~
736
+
737
+
If you would like to pull the entire data set in Arrow format but without streaming, you can use the `toArrowTable` helper to get a https://arrow.apache.org/docs/js/classes/Arrow_dom.Table.html[Table] back instead.
0 commit comments