You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2016/03/29 21:47:33 UTC

spark git commit: [MINOR][SQL] Fix exception message to print string-array correctly.

Repository: spark
Updated Branches:
  refs/heads/master d612228ef -> 838cb4583


[MINOR][SQL] Fix exception message to print string-array correctly.

## What changes were proposed in this pull request?

This PR is a simple fix for an exception message to print `string[]` content correctly.
```java
String[] colPath = requestedSchema.getPaths().get(i);
...
-          throw new IOException("Required column is missing in data file. Col: " + colPath);
+          throw new IOException("Required column is missing in data file. Col: " + Arrays.toString(colPath));
```

## How was this patch tested?

Manual.

Author: Dongjoon Hyun <do...@apache.org>

Closes #12041 from dongjoon-hyun/fix_exception_message_with_string_array.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/838cb458
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/838cb458
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/838cb458

Branch: refs/heads/master
Commit: 838cb4583dd68a9d7ef3bd74b9b4d33f32f177fc
Parents: d612228
Author: Dongjoon Hyun <do...@apache.org>
Authored: Tue Mar 29 12:47:30 2016 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Tue Mar 29 12:47:30 2016 -0700

----------------------------------------------------------------------
 .../datasources/parquet/VectorizedParquetRecordReader.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/838cb458/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java
----------------------------------------------------------------------
diff --git a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java
index 5bfde55..0bdf4aa 100644
--- a/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java
+++ b/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java
@@ -18,6 +18,7 @@
 package org.apache.spark.sql.execution.datasources.parquet;
 
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.hadoop.mapreduce.InputSplit;
@@ -269,7 +270,8 @@ public class VectorizedParquetRecordReader extends SpecificParquetRecordReaderBa
       } else {
         if (requestedSchema.getColumns().get(i).getMaxDefinitionLevel() == 0) {
           // Column is missing in data but the required data is non-nullable. This file is invalid.
-          throw new IOException("Required column is missing in data file. Col: " + colPath);
+          throw new IOException("Required column is missing in data file. Col: " +
+            Arrays.toString(colPath));
         }
         missingColumns[i] = true;
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org