From d780ed8b5c9156ac8595ac5cbb77d83c65fad64c Mon Sep 17 00:00:00 2001
From: Nong Li <nong@databricks.com>
Date: Sat, 27 Feb 2016 19:45:57 -0800
Subject: [PATCH] [SPARK-13533][SQL] Fix readBytes in
 VectorizedPlainValuesReader

## What changes were proposed in this pull request?

Fix readBytes in VectorizedPlainValuesReader. This fixes a copy and paste issue.

## How was this patch tested?

Ran ParquetHadoopFsRelationSuite which failed before this.

Author: Nong Li <nong@databricks.com>

Closes #11414 from nongli/spark-13533.
---
 .../datasources/parquet/VectorizedPlainValuesReader.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java
index bf3283e853..57cc28e9f4 100644
--- a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java
+++ b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java
@@ -85,7 +85,7 @@ public class VectorizedPlainValuesReader extends ValuesReader implements Vectori
     for (int i = 0; i < total; i++) {
       // Bytes are stored as a 4-byte little endian int. Just read the first byte.
       // TODO: consider pushing this in ColumnVector by adding a readBytes with a stride.
-      c.putInt(rowId + i, buffer[offset]);
+      c.putByte(rowId + i, buffer[offset]);
       offset += 4;
     }
   }
-- 
GitLab