Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Fixed/Implemented Chunked Read. #585

Closed
wants to merge 2 commits into from
Closed

Conversation

gopalkpd
Copy link

@gopalkpd gopalkpd commented May 4, 2018

The document mentions that InfluxDBClient.Query method returns one ResultSet per data chunk
if chunking is enabled by setting the chunked parameter to True. But only one ResultSet containing all
data rows was being returned. This in effect is like having no chunking and retrieving all data in one shot.
Also, for chunked data read to work, streaming should be enabled on the underlying requests.Session.request method
by setting the stream parameter to True. This was not being done.

Made the following changes to make the chunked read work as documented.

  • Updated the method _read_chunked_response to make it a generator that yields
    one ResultSet per data chunk.

  • Enabling streaming on requests.Session.request by passing the parameter “stream=True”
    whenever chunking is enabled on InfluxDBClient.Query.

  • Updated the entire call chain from InfluxDBClient.Query to requests.Session.request method
    to support streaming by adding the parameter “stream”.

gopalkcfx and others added 2 commits May 3, 2018 18:31
The document mentions that InfluxDBClient.Query method returns one ResultSet per data chunk
if chunking is enabled by setting the chunked parameter to True. But only one ResultSet containing all
data rows was being returned. This in effect is like having no chunking and retrieving all data in one shot.
Also, for chunked data read to work, streaming should be enabled on the underlying requests.Session.request method
by setting the stream parameter to True. This was not being done.

Made the following changes to make the chunked read work as documented.

*	Updated the method _read_chunked_response to make it a generator that yields
	one ResultSet per data chunk.

*	Enabling streaming on requests.Session.request by passing the parameter “stream=True”
	whenever chunking is enabled on InfluxDBClient.Query.

*	Updated the entire call chain from InfluxDBClient.Query to requests.Session.request method
	to support streaming by adding the parameter “stream”.
hrbonz added a commit to hrbonz/influxdb-python that referenced this pull request Sep 8, 2019
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L410)

close influxdata#585
close influxdata#531
hrbonz added a commit to hrbonz/influxdb-python that referenced this pull request Sep 8, 2019
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L410)

close influxdata#585
close influxdata#531
hrbonz added a commit to hrbonz/influxdb-python that referenced this pull request Sep 8, 2019
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L410)

close influxdata#585
close influxdata#531
@psy0rz
Copy link

psy0rz commented Oct 9, 2019

Isnt this trying to fix the same thing as #538 ?

hrbonz added a commit to hrbonz/influxdb-python that referenced this pull request Mar 23, 2020
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L429)

close influxdata#585
close influxdata#531
hrbonz added a commit to hrbonz/influxdb-python that referenced this pull request Mar 23, 2020
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L429)

close influxdata#585
close influxdata#531
@sebito91 sebito91 self-assigned this Apr 8, 2020
@sebito91
Copy link
Contributor

Duplicate of #538.

@sebito91 sebito91 closed this Apr 10, 2020
sebito91 pushed a commit that referenced this pull request Apr 10, 2020
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L429)

Closes #585.
Closes #531.
Closes #538.
ocworld pushed a commit to AhnLab-OSS/influxdb-python that referenced this pull request Apr 13, 2020
When querying large data sets, it's vital to get a chunked responses to
manage memory usage. Wrapping the query response in a generator and
streaming the request provides the desired result.
It also fixes `InfluxDBClient.query()` behavior for chunked queries that
is currently not working according to
[specs](https://github.com/influxdata/influxdb-python/blob/master/influxdb/client.py#L429)

Closes influxdata#585.
Closes influxdata#531.
Closes influxdata#538.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants