You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/28 15:33:09 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #12829: ARROW-16116: [C++] Handle non-nullable fields when reading Parquet

lidavidm commented on code in PR #12829:
URL: https://github.com/apache/arrow/pull/12829#discussion_r861034423


##########
cpp/src/parquet/arrow/reader_internal.cc:
##########
@@ -409,22 +441,36 @@ Status TransferDate64(RecordReader* reader, MemoryPool* pool,
 
 Status TransferDictionary(RecordReader* reader,
                           const std::shared_ptr<DataType>& logical_value_type,
-                          std::shared_ptr<ChunkedArray>* out) {
+                          bool nullable, std::shared_ptr<ChunkedArray>* out) {
   auto dict_reader = dynamic_cast<DictionaryRecordReader*>(reader);
   DCHECK(dict_reader);
   *out = dict_reader->GetResult();
   if (!logical_value_type->Equals(*(*out)->type())) {
     ARROW_ASSIGN_OR_RAISE(*out, (*out)->View(logical_value_type));
   }
+  if (!nullable) {
+    // Reconstruct each chunk without nulls.

Review Comment:
   We have to set null_count = 0 and then either we have to drop or reconstruct the null buffer (and then of course it makes more sense to just drop it). I've factored this out.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org