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 2020/10/03 00:33:26 UTC

[GitHub] [arrow] nevi-me commented on a change in pull request #8291: ARROW-8426: [Rust] [Parquet] Add support for writing dictionary types

nevi-me commented on a change in pull request #8291:
URL: https://github.com/apache/arrow/pull/8291#discussion_r499097627



##########
File path: rust/arrow/src/ipc/convert.rs
##########
@@ -609,10 +621,45 @@ pub(crate) fn get_fb_field_type<'a: 'b, 'b>(
                 children: Some(fbb.create_vector(&children[..])),
             }
         }
+        Dictionary(_, value_type) => {
+            // In this library, the dictionary "type" is a logical construct. Here we
+            // pass through to the value type, as we've already captured the index
+            // type in the DictionaryEncoding metadata in the parent field
+            get_fb_field_type(value_type, fbb)
+        }
         t => unimplemented!("Type {:?} not supported", t),
     }
 }
 
+/// Create an IPC dictionary encoding
+pub(crate) fn get_fb_dictionary<'a: 'b, 'b>(
+    index_type: &DataType,
+    dict_id: i64,
+    dict_is_ordered: bool,
+    fbb: &mut FlatBufferBuilder<'a>,
+) -> WIPOffset<ipc::DictionaryEncoding<'b>> {
+    // We assume that the dictionary index type (as an integer) has already been
+    // validated elsewhere, and can safely assume we are dealing with signed
+    // integers
+    let mut index_builder = ipc::IntBuilder::new(fbb);
+    index_builder.add_is_signed(true);

Review comment:
       @carols10cents we can address this in future, I'm merging this




----------------------------------------------------------------
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.

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