This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch num_info_bug in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 7f56568bf86513703a2c3815d5713c2fe0d36dc2 Author: HTHou <[email protected]> AuthorDate: Thu Nov 3 00:24:14 2022 +0800 [To rel/0.13] Fix String number infer bug --- client-cpp/pom.xml | 4 ++-- compile-tools/pom.xml | 6 +++--- distribution/pom.xml | 2 +- example/client-cpp-example/pom.xml | 2 +- example/trigger/pom.xml | 2 +- example/udf/pom.xml | 2 +- grafana-connector/pom.xml | 2 +- integration/pom.xml | 6 +++--- jdbc/pom.xml | 2 +- pom.xml | 8 ++++---- .../main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java | 6 +++++- .../java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java | 6 ++++-- 12 files changed, 27 insertions(+), 21 deletions(-) diff --git a/client-cpp/pom.xml b/client-cpp/pom.xml index 6a7ac1e630..576a42cdb6 100644 --- a/client-cpp/pom.xml +++ b/client-cpp/pom.xml @@ -116,8 +116,8 @@ <cmake.root.dir>${project.parent.basedir}/compile-tools/thrift/target/cmake-${cmake-version}-win64-x64/</cmake.root.dir> <thrift.exec.absolute.path>${project.parent.basedir}/compile-tools/thrift/target/build/compiler/cpp/bin/${cmake.build.type}/thrift.exe</thrift.exec.absolute.path> <iotdb.server.script>start-server.bat</iotdb.server.script> - <boost.include.dir /> - <boost.library.dir /> + <boost.include.dir/> + <boost.library.dir/> </properties> </profile> <profile> diff --git a/compile-tools/pom.xml b/compile-tools/pom.xml index 89a525c0a5..d3e1ae34da 100644 --- a/compile-tools/pom.xml +++ b/compile-tools/pom.xml @@ -35,7 +35,7 @@ <cmake-version>3.17.3</cmake-version> <openssl.include.dir>-Dtrue1=true1</openssl.include.dir> <bison.executable.dir>-Dtrue1=true1</bison.executable.dir> - <cmake.build.type /> + <cmake.build.type/> </properties> <modules> <module>thrift</module> @@ -138,8 +138,8 @@ <thrift.make.executable>make</thrift.make.executable> <thrift.compiler.executable>thrift.exe</thrift.compiler.executable> <gradlew.executable>gradlew.bat</gradlew.executable> - <boost.include.dir /> - <boost.library.dir /> + <boost.include.dir/> + <boost.library.dir/> </properties> </profile> </profiles> diff --git a/distribution/pom.xml b/distribution/pom.xml index ef29bfd121..fe4693ebf3 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -29,7 +29,7 @@ </parent> <artifactId>iotdb-distribution</artifactId> <name>IoTDB Distribution</name> - <modules /> + <modules/> <build> <plugins> <plugin> diff --git a/example/client-cpp-example/pom.xml b/example/client-cpp-example/pom.xml index c55b2bc561..463f001812 100644 --- a/example/client-cpp-example/pom.xml +++ b/example/client-cpp-example/pom.xml @@ -84,7 +84,7 @@ <properties> <cmake.generator>Visual Studio 16 2019</cmake.generator> <cmake.root.dir>${project.parent.basedir}/../compile-tools/thrift/target/cmake-${cmake-version}-win64-x64/</cmake.root.dir> - <boost.include.dir /> + <boost.include.dir/> </properties> </profile> <profile> diff --git a/example/trigger/pom.xml b/example/trigger/pom.xml index f0f694690c..b13a63f292 100644 --- a/example/trigger/pom.xml +++ b/example/trigger/pom.xml @@ -118,7 +118,7 @@ <importOrder> <order>org.apache.iotdb,,javax,java,\#</order> </importOrder> - <removeUnusedImports /> + <removeUnusedImports/> </java> </configuration> <executions> diff --git a/example/udf/pom.xml b/example/udf/pom.xml index 37eb9ba008..fc485a3138 100644 --- a/example/udf/pom.xml +++ b/example/udf/pom.xml @@ -118,7 +118,7 @@ <importOrder> <order>org.apache.iotdb,,javax,java,\#</order> </importOrder> - <removeUnusedImports /> + <removeUnusedImports/> </java> </configuration> <executions> diff --git a/grafana-connector/pom.xml b/grafana-connector/pom.xml index bfc397eb56..4e017662fd 100644 --- a/grafana-connector/pom.xml +++ b/grafana-connector/pom.xml @@ -170,7 +170,7 @@ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>${start-class}</mainClass> </transformer> diff --git a/integration/pom.xml b/integration/pom.xml index 7ee33b0db2..ee0f0e8234 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -80,7 +80,7 @@ <id>LocalStandalone</id> <properties> <test.includedGroups>org.apache.iotdb.itbase.category.LocalStandaloneTest</test.includedGroups> - <test.excludedGroups /> + <test.excludedGroups/> </properties> <activation> <activeByDefault>true</activeByDefault> @@ -142,7 +142,7 @@ <id>Remote</id> <properties> <test.includedGroups>org.apache.iotdb.itbase.category.RemoteTest</test.includedGroups> - <test.excludedGroups /> + <test.excludedGroups/> </properties> <activation> <activeByDefault>false</activeByDefault> @@ -206,7 +206,7 @@ <id>Cluster</id> <properties> <test.includedGroups>org.apache.iotdb.itbase.category.ClusterTest</test.includedGroups> - <test.excludedGroups /> + <test.excludedGroups/> </properties> <activation> <activeByDefault>false</activeByDefault> diff --git a/jdbc/pom.xml b/jdbc/pom.xml index 359400dd39..697e5a1750 100644 --- a/jdbc/pom.xml +++ b/jdbc/pom.xml @@ -203,7 +203,7 @@ </goals> </pluginExecutionFilter> <action> - <ignore /> + <ignore/> </action> </pluginExecution> </pluginExecutions> diff --git a/pom.xml b/pom.xml index 3166db9faf..71b12d6108 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ <sonar.junit.reportPaths>target/surefire-reports,target/failsafe-reports</sonar.junit.reportPaths> <!-- By default, the argLine is empty--> <gson.version>2.8.8</gson.version> - <argLine /> + <argLine/> <!-- whether enable compiling the cpp client--> <client-cpp>false</client-cpp> <!-- disable enforcer by default--> @@ -695,7 +695,7 @@ <importOrder> <order>org.apache.iotdb,,javax,java,\#</order> </importOrder> - <removeUnusedImports /> + <removeUnusedImports/> </java> <lineEndings>UNIX</lineEndings> </configuration> @@ -770,7 +770,7 @@ <phase>validate</phase> <configuration> <rules> - <dependencyConvergence /> + <dependencyConvergence/> </rules> </configuration> <goals> @@ -816,7 +816,7 @@ </requireJavaVersion> <!-- Disabled for now as it breaks the ability to build single modules --> <!--reactorModuleConvergence/--> - <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies" /> + <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies"/> </rules> </configuration> </execution> diff --git a/server/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java b/server/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java index ecd646ca6e..c64b43a139 100644 --- a/server/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java +++ b/server/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java @@ -63,7 +63,11 @@ public class TypeInferenceUtils { } private static boolean isConvertFloatPrecisionLack(String s) { - return Long.parseLong(s) > (2 << 24); + try { + return Long.parseLong(s) > (2 << 24); + } catch (NumberFormatException e) { + return true; + } } /** Get predicted DataType of the given value */ diff --git a/server/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java b/server/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java index 9267cd9b0e..483cf78dd3 100644 --- a/server/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java +++ b/server/src/test/java/org/apache/iotdb/db/utils/TypeInferenceUtilsTest.java @@ -72,7 +72,8 @@ public class TypeInferenceUtilsTest { "9999999999999999", "true", "77123 ", - " 7112324 " + " 7112324 ", + "271840880000000000000000" }; TSDataType[] encodings = { IoTDBDescriptor.getInstance().getConfig().getIntegerStringInferType(), @@ -85,7 +86,8 @@ public class TypeInferenceUtilsTest { IoTDBDescriptor.getInstance().getConfig().getLongStringInferType(), IoTDBDescriptor.getInstance().getConfig().getBooleanStringInferType(), IoTDBDescriptor.getInstance().getConfig().getIntegerStringInferType(), - IoTDBDescriptor.getInstance().getConfig().getIntegerStringInferType() + IoTDBDescriptor.getInstance().getConfig().getIntegerStringInferType(), + IoTDBDescriptor.getInstance().getConfig().getLongStringInferType() }; for (int i = 0; i < values.length; i++) {
