Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-1042 [created] 6f66e8732
HAWQ-1042. Fixed NPE. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/6f66e873 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/6f66e873 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/6f66e873 Branch: refs/heads/HAWQ-1042 Commit: 6f66e8732d7e29678699039933023cbb1d03ef81 Parents: b0cc555 Author: Oleksandr Diachenko <[email protected]> Authored: Wed Sep 7 17:59:03 2016 -0700 Committer: Oleksandr Diachenko <[email protected]> Committed: Wed Sep 7 17:59:03 2016 -0700 ---------------------------------------------------------------------- .../apache/hawq/pxf/api/utilities/ColumnDescriptor.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6f66e873/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/ColumnDescriptor.java ---------------------------------------------------------------------- diff --git a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/ColumnDescriptor.java b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/ColumnDescriptor.java index a2bc8fe..7ae15e4 100644 --- a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/ColumnDescriptor.java +++ b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/ColumnDescriptor.java @@ -65,9 +65,13 @@ public class ColumnDescriptor { this.dbColumnName = copy.dbColumnName; this.dbColumnIndex = copy.dbColumnIndex; this.dbColumnTypeName = copy.dbColumnTypeName; - System.arraycopy(this.dbColumnTypeModifiers, 0, - copy.dbColumnTypeModifiers, 0, - this.dbColumnTypeModifiers.length); + if (copy.dbColumnTypeModifiers != null + && copy.dbColumnTypeModifiers.length > 0) { + this.dbColumnTypeModifiers = new Integer[copy.dbColumnTypeModifiers.length]; + System.arraycopy(copy.dbColumnTypeModifiers, 0, + this.dbColumnTypeModifiers, 0, + copy.dbColumnTypeModifiers.length); + } } public String columnName() {
