From 7fd6c42430deba698a685fa6eb3cc1eee70f9674 Mon Sep 17 00:00:00 2001
From: NguyenHoangSon96 <46211823+NguyenHoangSon96@users.noreply.github.com>
Date: Fri, 6 Dec 2024 11:57:23 +0700
Subject: [PATCH] feat: respect iox::column_type::field metadata when mapping
query (#200)
---
CHANGELOG.md | 12 +-
pom.xml | 2 +-
.../client/internal/InfluxDBClientImpl.java | 23 +-
.../client/internal/NanosecondConverter.java | 58 +++++
.../v3/client/internal/TypeCasting.java | 81 ++++++
.../internal/VectorSchemaRootConverter.java | 161 ++++++++----
.../v3/client/InfluxDBClientTest.java | 59 ++++-
.../internal/NanosecondConverterTest.java | 91 +++++++
.../v3/client/internal/TypeCastingTest.java | 57 ++++
.../VectorSchemaRootConverterTest.java | 145 +++++++++--
.../internal/VectorSchemaRootUtils.java | 243 ++++++++++++++++++
11 files changed, 836 insertions(+), 96 deletions(-)
create mode 100644 src/main/java/com/influxdb/v3/client/internal/TypeCasting.java
create mode 100644 src/test/java/com/influxdb/v3/client/internal/NanosecondConverterTest.java
create mode 100644 src/test/java/com/influxdb/v3/client/internal/TypeCastingTest.java
create mode 100644 src/test/java/com/influxdb/v3/client/internal/VectorSchemaRootUtils.java
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a862efc..2e1e805a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,14 @@
-## 0.10.0 [unreleased]
+## 1.0.0 [unreleased]
+
+### Features
+
+1. [#200](https://github.com/InfluxCommunity/influxdb3-java/pull/200): Respect iox::column_type::field metadata when
+ mapping query results into values.
+ - iox::column_type::field::integer: => Long
+ - iox::column_type::field::uinteger: => Long
+ - iox::column_type::field::float: => Double
+ - iox::column_type::field::string: => String
+ - iox::column_type::field::boolean: => Boolean
### Dependencies
diff --git a/pom.xml b/pom.xml
index 4909797b..383856cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
com.influxdb
influxdb3-java
jar
- 0.10.0-SNAPSHOT
+ 1.0.0-SNAPSHOT
InfluxDB 3 Java Client
diff --git a/src/main/java/com/influxdb/v3/client/internal/InfluxDBClientImpl.java b/src/main/java/com/influxdb/v3/client/internal/InfluxDBClientImpl.java
index f43178b8..6d67b7d0 100644
--- a/src/main/java/com/influxdb/v3/client/internal/InfluxDBClientImpl.java
+++ b/src/main/java/com/influxdb/v3/client/internal/InfluxDBClientImpl.java
@@ -24,7 +24,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -181,19 +180,13 @@ public Stream