You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by lz...@apache.org on 2020/03/23 06:00:27 UTC

[flink] branch release-1.10 updated: [FLINK-16652][orc] BytesColumnVector should init buffer in Hive 3.x

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

lzljs3620320 pushed a commit to branch release-1.10
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.10 by this push:
     new 7a01a1d  [FLINK-16652][orc] BytesColumnVector should init buffer in Hive 3.x
7a01a1d is described below

commit 7a01a1d08a1a5a781d0daa8f6aa0b3b63f67246e
Author: Jingsong Lee <ji...@gmail.com>
AuthorDate: Mon Mar 23 13:55:54 2020 +0800

    [FLINK-16652][orc] BytesColumnVector should init buffer in Hive 3.x
    
    
    This closes #11485
---
 .../java/org/apache/flink/orc/vector/AbstractOrcColumnVector.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/AbstractOrcColumnVector.java b/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/AbstractOrcColumnVector.java
index 8cabe7f..eedd4d4 100644
--- a/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/AbstractOrcColumnVector.java
+++ b/flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/AbstractOrcColumnVector.java
@@ -143,9 +143,11 @@ public abstract class AbstractOrcColumnVector implements
 			bcv.isNull[0] = true;
 			bcv.isRepeating = true;
 		} else {
-			bcv.fill(value instanceof byte[] ?
+			byte[] bytes = value instanceof byte[] ?
 					(byte[]) value :
-					value.toString().getBytes(StandardCharsets.UTF_8));
+					value.toString().getBytes(StandardCharsets.UTF_8);
+			bcv.initBuffer(bytes.length);
+			bcv.fill(bytes);
 			bcv.isNull[0] = false;
 		}
 		return bcv;