You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4a121b6
Browse filesBrowse the repository at this point in the historyBrowse files
ARROW-11173: [Java] Add map type in complex reader / writer
This pull request adds support for Map types in FieldReader and FieldWriter.
Initial unit tests show how to add the following nested types:
- A list of maps: `List<Map<Integer, Long>>`
- Nesting a map as the value of another map: `Map<Long, Map<Long, Long>>`
- Nesting maps as both the key and value of another map: `Map<Map<Integer, Integer>, Map<Long, Long>>`
Appreciate any feedback or suggestions for improvement.
Closesapache#9151 from nbruno/ARROW-11173
Authored-by: Nick Bruno <nbruno@users.noreply.github.com>
Signed-off-by: Micah Kornfield <emkornfield@gmail.com>
Copy file name to clipboardExpand all lines: java/vector/src/main/codegen/templates/AbstractFieldWriter.java
+55-2Lines changed: 55 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -56,12 +56,42 @@ public void end() {
56
56
57
57
@Override
58
58
publicvoidstartList() {
59
-
thrownewIllegalStateException(String.format("You tried to start when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
59
+
thrownewIllegalStateException(String.format("You tried to start a list when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
60
60
}
61
61
62
62
@Override
63
63
publicvoidendList() {
64
-
thrownewIllegalStateException(String.format("You tried to end when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
64
+
thrownewIllegalStateException(String.format("You tried to end a list when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
65
+
}
66
+
67
+
@Override
68
+
publicvoidstartMap() {
69
+
thrownewIllegalStateException(String.format("You tried to start a map when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
70
+
}
71
+
72
+
@Override
73
+
publicvoidendMap() {
74
+
thrownewIllegalStateException(String.format("You tried to end a map when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
75
+
}
76
+
77
+
@Override
78
+
publicvoidstartEntry() {
79
+
thrownewIllegalStateException(String.format("You tried to start a map entry when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
80
+
}
81
+
82
+
@Override
83
+
publicMapWriterkey() {
84
+
thrownewIllegalStateException(String.format("You tried to start a map key when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
85
+
}
86
+
87
+
@Override
88
+
publicMapWritervalue() {
89
+
thrownewIllegalStateException(String.format("You tried to start a map value when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
90
+
}
91
+
92
+
@Override
93
+
publicvoidendEntry() {
94
+
thrownewIllegalStateException(String.format("You tried to end a map entry when you are using a ValueWriter of type %s.", this.getClass().getSimpleName()));
0 commit comments