You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/03/12 17:50:02 UTC

arrow git commit: ARROW-612: [Java] Added not null to Field.toString output

Repository: arrow
Updated Branches:
  refs/heads/master 344ad1f10 -> d4ecb5e54


ARROW-612: [Java] Added not null to Field.toString output

Changed `Field.toString` method to include an additional `not null` description only if the nullable flag is not set.  Changed test to update expected string output.

Author: Bryan Cutler <cu...@gmail.com>

Closes #368 from BryanCutler/Field-toString-show-nullable-ARROW-612 and squashes the following commits:

9dc633d [Bryan Cutler] added not null to Field.toString output


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

Branch: refs/heads/master
Commit: d4ecb5e54eb7bc9392ad2f4e1cf9a0fe42be8cd0
Parents: 344ad1f
Author: Bryan Cutler <cu...@gmail.com>
Authored: Sun Mar 12 13:49:53 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Sun Mar 12 13:49:53 2017 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/arrow/vector/types/pojo/Field.java   | 3 +++
 .../test/java/org/apache/arrow/vector/types/pojo/TestSchema.java  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/d4ecb5e5/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java
----------------------------------------------------------------------
diff --git a/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java b/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java
index 2d528e4..f9b79ce 100644
--- a/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java
+++ b/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java
@@ -185,6 +185,9 @@ public class Field {
     if (!children.isEmpty()) {
       sb.append("<").append(Joiner.on(", ").join(children)).append(">");
     }
+    if (!nullable) {
+      sb.append(" not null");
+    }
     return sb.toString();
   }
 }

http://git-wip-us.apache.org/repos/asf/arrow/blob/d4ecb5e5/java/vector/src/test/java/org/apache/arrow/vector/types/pojo/TestSchema.java
----------------------------------------------------------------------
diff --git a/java/vector/src/test/java/org/apache/arrow/vector/types/pojo/TestSchema.java b/java/vector/src/test/java/org/apache/arrow/vector/types/pojo/TestSchema.java
index d60d17e..f04c78e 100644
--- a/java/vector/src/test/java/org/apache/arrow/vector/types/pojo/TestSchema.java
+++ b/java/vector/src/test/java/org/apache/arrow/vector/types/pojo/TestSchema.java
@@ -53,7 +53,7 @@ public class TestSchema {
         ));
     roundTrip(schema);
     assertEquals(
-        "Schema<a: Int(8, true), b: Struct<c: Int(16, true), d: Utf8>, e: List<Date>, f: FloatingPoint(SINGLE), g: Timestamp(MILLISECOND), h: Interval(DAY_TIME)>",
+        "Schema<a: Int(8, true) not null, b: Struct<c: Int(16, true), d: Utf8>, e: List<Date>, f: FloatingPoint(SINGLE), g: Timestamp(MILLISECOND), h: Interval(DAY_TIME)>",
         schema.toString());
   }