influxdata / influxdata/docs-v2

Doc of Influxdb 3 core should mention that the client gets a `java.time.LocalDateTime` without time zone information through `/api/v3/query_sql`

Open
#5,863 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
82
Forks
326
Avg merge
1d 1h
Merged PRs (30d)
82

Description

- Doc of Influxdb 3 core should mention that the client gets a `java.time.LocalDateTime` without time zone information through `/api/v3/query_sql`.
- The current documentation for Influxdb 3 core barely mentions a java-specific scenario.
- When I tested the SQL `select time,location,value from home order by time desc limit 10` for `/api/v3/query_sql` in https://github.com/linghengqian/influxdb-3-core-jdbc-test/blob/master/src/test/java/io/github/linghengqian/TimeDifferenceTest.java , I found that I got a `java.time.LocalDateTime`. When inserting data into influxdb 3 core, `java.time.Instant` is often used.
```java
private final Instant magicTime = Instant.now().minusSeconds(10);

@Container
private final GenericContainer container = new GenericContainer<>("quay.io/influxdb/influxdb3-core:911ba92ab4133e75fe2a420e16ed9cb4cf32196f")
.withCommand("serve --node-id local01 --object-store memory")
.withExposedPorts(8181);

private void queryDataByHttp() throws URISyntaxException, IOException, InterruptedException {
URI uri = new URIBuilder().setScheme("http")
.setHost(container.getHost())
.setPort(container.getMappedPort(8181))
.setPath("/api/v3/query_sql")
.setParameter("db", "mydb")
.setParameter("q", "select time,location,value from home order by time desc limit 10")
.build();
HttpResponse response = HttpClient.newHttpClient()
.send(HttpRequest.newBuilder().uri(uri).GET().build(), BodyHandlers.ofString());
assertThat(
new ObjectMapper().readTree(response.body()).get(0).get("time").asText(),
is(magicTime.atOffset(ZoneOffset.UTC).toLocalDateTime().toString())
);
}
```

- I think such a big difference should be properly mentioned in the document.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked TimeDifferenceTest.java and the current InfluxDB 3 core documentation for /api/v3/query_sql. Document that query results provide java.time.LocalDateTime without time-zone information, contrasting it with the java.time.Instant commonly used when inserting data. Done means the Java-specific behavior and distinction are clearly stated in the relevant documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.