carols10cents commented on a change in pull request #8402:
URL: https://github.com/apache/arrow/pull/8402#discussion_r512257282



##########
File path: rust/parquet/src/arrow/arrow_writer.rs
##########
@@ -176,19 +176,175 @@ fn write_leaves(
             }
             Ok(())
         }
+        ArrowDataType::Dictionary(key_type, value_type) => {
+            use arrow_array::{
+                Int16DictionaryArray, Int32DictionaryArray, 
Int64DictionaryArray,
+                Int8DictionaryArray, PrimitiveArray, StringArray, 
UInt16DictionaryArray,
+                UInt32DictionaryArray, UInt64DictionaryArray, 
UInt8DictionaryArray,
+            };
+            use ArrowDataType::*;
+            use ColumnWriter::*;
+
+            let array = &**array;
+            let mut col_writer = get_col_writer(&mut row_group_writer)?;
+            let levels = levels.pop().expect("Levels exhausted");
+
+            macro_rules! dispatch_dictionary {
+                ($($kt: pat, $vt: pat, $w: ident => $kat: ty, $vat: ty,)*) => (
+                    match (&**key_type, &**value_type, &mut col_writer) {
+                        $(($kt, $vt, $w(writer)) => write_dict::<$kat, $vat, 
_>(array, writer, levels),)*
+                        (kt, vt, _) => panic!("Don't know how to write 
dictionary of <{:?}, {:?}>", kt, vt),

Review comment:
       I think this should probably be `unreachable!`; it's similar to [this 
spot](https://github.com/apache/arrow/pull/8402/commits/91a22bb00a202e10f3f5fc2970bea726baddfb03)
 where the code shouldn't get to that spot.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to