This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 74404a333ac Unify string type inference (#13094)
74404a333ac is described below
commit 74404a333ac5af3d3ba65328897c31f45fa8db12
Author: Haonan <[email protected]>
AuthorDate: Tue Aug 6 18:14:58 2024 +0800
Unify string type inference (#13094)
* Unify string type inference
* rm useless submodule
---
.../src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java | 2 +-
.../test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java
index 165ea4b8b0f..e2772cd08e4 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java
@@ -58,7 +58,7 @@ public class TypeInferenceUtils {
} catch (NumberFormatException e) {
return false;
}
- return true;
+ return !s.endsWith("F") && !s.endsWith("f") && !s.endsWith("D") &&
!s.endsWith("d");
}
private static boolean isBoolean(String s) {
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java
index 9933d61c688..cc63f38edfd 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java
@@ -82,6 +82,8 @@ public class TypeInferenceUtilsTest {
"4.9387406015404442E17",
"4E5",
"1.0",
+ "4F",
+ "4L"
};
TSDataType[] inferredTypes = {
TSDataType.INT32,
@@ -100,7 +102,9 @@ public class TypeInferenceUtilsTest {
config.getFloatingStringInferType(),
config.getFloatingStringInferType(),
config.getFloatingStringInferType(),
- config.getFloatingStringInferType()
+ config.getFloatingStringInferType(),
+ TSDataType.TEXT,
+ TSDataType.TEXT,
};
for (int i = 0; i < values.length; i++) {