Skip to content

Commit

Permalink
fix: updates IOxExample.java to work with current PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
karel-rehor committed Dec 8, 2023
1 parent 844d7b0 commit 165d142
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/src/main/java/com/influxdb/v3/IOxExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.stream.Stream;

import com.influxdb.v3.client.InfluxDBClient;
Expand Down Expand Up @@ -100,8 +101,8 @@ public static void main(final String[] args) throws Exception {
try (Stream<PointValues> stream = client.queryPoints(sql)) {
stream.forEach(
(PointValues p) -> {
var time = p.getField("time", LocalDateTime.class);
var location = p.getField("location", String.class);
var time = p.getTimestamp();
var location = p.getTag("location");
var value = p.getField("value", Double.class);

System.out.printf("| %-8s | %-8s | %-30s |%n", location, value, time);
Expand Down

0 comments on commit 165d142

Please sign in to comment.