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

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 9552adfc82f9bc1881be5c29be78ce231d5a7ae7
Author: spaces-x <[email protected]>
AuthorDate: Tue Apr 26 10:14:21 2022 +0800

    [fix](spark load) fix `getHashValue` of string type is always zero in spark 
load. (#9136)
    
    Buffer flip is used incorrectly.
    When the hash key is string type, the hash value is always zero.
    The reason is that the buffer of string type is obtained by wrap, which is 
not needed to flip.
    If we do so, the buffer limit for read will be zero.
---
 .../src/main/java/org/apache/doris/load/loadv2/dpp/DppUtils.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/DppUtils.java 
b/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/DppUtils.java
index a019338bc3..1249cac993 100644
--- a/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/DppUtils.java
+++ b/fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/DppUtils.java
@@ -182,7 +182,10 @@ public class DppUtils {
             byte value = (byte) (b ? 1 : 0);
             buffer.put(value);
         }
-        buffer.flip();
+        // do not flip buffer when the buffer was created by wrap()
+        if (!type.equals(DataTypes.StringType)) {
+            buffer.flip();
+        }
         return buffer;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to