This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c5a66a43 [INLONG-6538][Sort] Fix wrong bool type convert in multiple 
sink scenes (#6539)
5c5a66a43 is described below

commit 5c5a66a4362e00e0c6fa913563d5d318965828a8
Author: thesumery <107393625+thesum...@users.noreply.github.com>
AuthorDate: Tue Nov 15 15:37:11 2022 +0800

    [INLONG-6538][Sort] Fix wrong bool type convert in multiple sink scenes 
(#6539)
---
 .../org/apache/inlong/sort/base/format/JsonToRowDataConverters.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/format/JsonToRowDataConverters.java
 
b/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/format/JsonToRowDataConverters.java
index da6128942..b4e2d3de6 100644
--- 
a/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/format/JsonToRowDataConverters.java
+++ 
b/inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/format/JsonToRowDataConverters.java
@@ -180,7 +180,9 @@ public class JsonToRowDataConverters implements 
Serializable {
             // avoid redundant toString and parseBoolean, for better 
performance
             return jsonNode.asBoolean();
         } else {
-            return Boolean.parseBoolean(jsonNode.asText().trim());
+            String boolStr = jsonNode.asText().trim();
+            // Compatible with tinyint data and bool conversion
+            return (boolStr != null) && ("true".equalsIgnoreCase(boolStr) || 
"1".equalsIgnoreCase(boolStr));
         }
     }
 

Reply via email to