@@ -133,27 +133,35 @@ public QueryStatus submit() throws TileDBError {
133
133
// Set the actual number of bytes received to each ByteBuffer
134
134
for (String attribute : byteBuffers_ .keySet ()) {
135
135
boolean isVar ;
136
+ boolean isNullable = false ;
137
+ Datatype datatype ;
136
138
137
139
try (ArraySchema arraySchema = array .getSchema ()) {
138
140
if (arraySchema .hasAttribute (attribute )) {
139
141
try (Attribute attr = arraySchema .getAttribute (attribute )) {
140
142
isVar = attr .isVar ();
143
+ isNullable = attr .getNullable ();
144
+ datatype = attr .getType ();
141
145
}
142
146
} else {
143
147
try (Dimension dim = arraySchema .getDomain ().getDimension (attribute )) {
144
148
isVar = dim .isVar ();
149
+ datatype = dim .getType ();
145
150
}
146
151
}
147
152
}
148
153
154
+ int nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
155
+ this .byteBuffers_ .get (attribute ).getSecond ().limit (nbytes );
156
+
149
157
if (isVar ) {
150
158
int offset_nbytes = this .buffer_sizes_ .get (attribute ).getFirst ().getitem (0 ).intValue ();
151
- int data_nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
152
159
this .byteBuffers_ .get (attribute ).getFirst ().limit (offset_nbytes );
153
- this .byteBuffers_ .get (attribute ).getSecond ().limit (data_nbytes );
154
- } else {
155
- int nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
156
- this .byteBuffers_ .get (attribute ).getSecond ().limit (nbytes );
160
+ }
161
+
162
+ if (isNullable ) {
163
+ int validity_nbytes = nbytes / datatype .getNativeSize ();
164
+ this .validityByteMapsByteBuffers_ .get (attribute ).limit (validity_nbytes );
157
165
}
158
166
}
159
167
@@ -177,27 +185,35 @@ public QueryStatus submitAndFinalize() throws TileDBError {
177
185
// Set the actual number of bytes received to each ByteBuffer
178
186
for (String attribute : byteBuffers_ .keySet ()) {
179
187
boolean isVar ;
188
+ boolean isNullable = false ;
189
+ Datatype datatype ;
180
190
181
191
try (ArraySchema arraySchema = array .getSchema ()) {
182
192
if (arraySchema .hasAttribute (attribute )) {
183
193
try (Attribute attr = arraySchema .getAttribute (attribute )) {
184
194
isVar = attr .isVar ();
195
+ isNullable = attr .getNullable ();
196
+ datatype = attr .getType ();
185
197
}
186
198
} else {
187
199
try (Dimension dim = arraySchema .getDomain ().getDimension (attribute )) {
188
200
isVar = dim .isVar ();
201
+ datatype = dim .getType ();
189
202
}
190
203
}
191
204
}
192
205
206
+ int nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
207
+ this .byteBuffers_ .get (attribute ).getSecond ().limit (nbytes );
208
+
193
209
if (isVar ) {
194
210
int offset_nbytes = this .buffer_sizes_ .get (attribute ).getFirst ().getitem (0 ).intValue ();
195
- int data_nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
196
211
this .byteBuffers_ .get (attribute ).getFirst ().limit (offset_nbytes );
197
- this .byteBuffers_ .get (attribute ).getSecond ().limit (data_nbytes );
198
- } else {
199
- int nbytes = this .buffer_sizes_ .get (attribute ).getSecond ().getitem (0 ).intValue ();
200
- this .byteBuffers_ .get (attribute ).getSecond ().limit (nbytes );
212
+ }
213
+
214
+ if (isNullable ) {
215
+ int validity_nbytes = nbytes / datatype .getNativeSize ();
216
+ this .validityByteMapsByteBuffers_ .get (attribute ).limit (validity_nbytes );
201
217
}
202
218
}
203
219
0 commit comments