Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
linghengqian opened this issue Feb 26, 2025 · 5 comments

Comments

@linghengqian
Copy link

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<String> 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.
@jstirnaman
Copy link
Contributor

@jeffreyssmith2nd This isn't specific to Core, is it?

@jeffreyssmith2nd
Copy link
Contributor

@mgattozzi or @hiltontj would know better than me, I'm not familiar with the /v3 apis.

@mgattozzi
Copy link

I think this might be a follow up to this if more context is needed

influxdata/influxdb#25983

@hiltontj
Copy link
Contributor

@linghengqian - would you mind pointing out which document you are referring to?

@linghengqian
Copy link
Author

@linghengqian - would you mind pointing out which document you are referring to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants