diff --git a/CHANGELOG.md b/CHANGELOG.md index 1026eaab86..091118f1a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,28 +1,26 @@ ## 7.2.0 [unreleased] -### Breaking Changes - -#### InfluxQLQuery default timestamp - -The default timestamp returned by `InfluxQLQueryAPI.query()` is no longer in the POSIX epoch format. It is now in the RFC3339 format. The Epoch format is still supported. It is sufficient to add the `epoch` query parameter to a query request via `InfluxQLQuery.setPrecision()` or to use a new dedicated CSV query method, `InfluxQLQueryAPI.queryCSV()`. - -See header changes in features below. - ### Features - [#719](https://github.com/influxdata/influxdb-client-java/issues/719): `InfluxQLQueryService` header changes. - - Now uses `Accept` header with the value `application/json` by default. - - The `Accept` header for InfluxQLQuery calls can now be set dynamically as either `application/json` or `application/csv`. + - `Accept` header can now be defined when making `InfluxQLQuery` calls. Supoorted MIME types: + - `application/csv` + - `application/json` + - The value `application/csv` remains the default. - :warning: Side effects of these changes: - - When using `application/json` timestamp fields are returned in the [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format. - - When using `application/csv` timestamp fields are returned in the POSIX epoch format. - - Convenience methods have been added to `InfluxQLQueryAPI` to simplify using CSV if desired. + - When using `application/json`, timestamp fields are returned in the [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format unless `InfluxQLQuery.setPrecision()` has been previously called, in which case they are returned in the POSIX epoch format. + - When using `application/csv`, timestamp fields are returned in the POSIX epoch format. + - Convenience methods have been added to `InfluxQLQueryAPI` to simplify expressly specifying JSON or CSV calls. - Epoch timestamps can also be ensured by calling `InfluxQLQuery.setPrecision()` before executing a query call. - An `AcceptHeader` field has also been added to the `InfluxQLQuery` class and can be set with `InfluxQLQuery.setAcceptHeader()`. - More information from the server side: - [Generated REST API Documentation](https://docs.influxdata.com/influxdb/v2/api/v1-compatibility/#operation/PostQueryV1) - [Influx 1.1 query compatibility](https://docs.influxdata.com/influxdb/latest/reference/api/influxdb-1x/query/) - - See the updated InfluxQLExample + - See the updated InfluxQLExample + +### Bug Fixes + +1. [#744](https://github.com/influxdata/influxdb-client-java/issues/744) following an `InfluxQLQueryAPI.query()` call, empty results from the server no longer result in a `null` result value. ### Dependencies diff --git a/client/src/main/java/com/influxdb/client/InfluxQLQueryApi.java b/client/src/main/java/com/influxdb/client/InfluxQLQueryApi.java index c718b7f3fa..9669a72e81 100644 --- a/client/src/main/java/com/influxdb/client/InfluxQLQueryApi.java +++ b/client/src/main/java/com/influxdb/client/InfluxQLQueryApi.java @@ -34,19 +34,28 @@ * {@link InfluxQLQuery#getRetentionPolicy() retention policy} specified in the query request to * map the request to an InfluxDB bucket. * - *
Note that as of release 7.2 queries using the legacy InfluxQL
compatible endpoint, will use
- * the default Accept
header mime type of application/json
instead of the previous
- * mime type of application/csv
. This means timestamps will be returned in the RFC3339 format,
- * e.g. "2024-06-18T11:29:48.454Z"
instead of in the Epoch format, e.g. 1655900000000000000
.
- *
Note that as of release 7.2 queries using the legacy InfluxQL
compatible endpoint can specify
+ * the Accept
header MIME type. Two MIME types are supported.
application/csv
- client default and legacy value.application/json
To continue to use the application/csv
mime type and to receive Epoch timestamps, use a
- * new convenience method queryCSV
. To explicitly indicate use of the application/json
- * mime type additional convenience methods queryJSON
are also now available. These are synonymous
- * with the original query
methods.
The selected Accept
header mime type impacts the timestamp format returned from the server.
application/csv
returns timestamps in the POSIX epoch format.application/json
returns timestamps as RFC3339 strings.
+ * InfluxQLQuery.setPrecision()
is called before the query is sent, then
+ * the timestamp will be returned as a POSIX epoch reflecting the desired precision, even when using the
+ * application/json
MIME type.Note that the Accept
header mime type can now also be specified when instantiating the
- *{@link com.influxdb.client.domain.InfluxQLQuery} class.
To explicitly choose one or the other MIME type new convenience methods are povided: queryCSV
+ * and queryJSON
. Note that the Accept
header MIME type can now also be specified
+ * when instantiating the {@link com.influxdb.client.domain.InfluxQLQuery} class.