You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/01/23 10:44:27 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3585: Iterate all dictionary key types in cast test

tustvold commented on code in PR #3585:
URL: https://github.com/apache/arrow-rs/pull/3585#discussion_r1083898305


##########
arrow/tests/array_cast.rs:
##########
@@ -409,19 +409,28 @@ fn get_all_types() -> Vec<DataType> {
             vec![0, 1],
             UnionMode::Dense,
         ),
-        Dictionary(Box::new(DataType::Int8), Box::new(DataType::Int32)),
-        Dictionary(Box::new(DataType::Int16), Box::new(DataType::Utf8)),
-        Dictionary(Box::new(DataType::Int16), Box::new(DataType::Binary)),
-        Dictionary(Box::new(DataType::UInt32), Box::new(DataType::Utf8)),
-        Dictionary(Box::new(DataType::UInt32), Box::new(DataType::Binary)),
         Decimal128(38, 0),
-        Dictionary(Box::new(DataType::Int8), Box::new(Decimal128(38, 0))),
-        Dictionary(Box::new(DataType::Int16), Box::new(Decimal128(38, 0))),
-        Dictionary(Box::new(DataType::UInt32), Box::new(Decimal128(38, 0))),
-        Dictionary(Box::new(DataType::Int8), Box::new(Decimal256(76, 0))),
-        Dictionary(Box::new(DataType::Int16), Box::new(Decimal256(76, 0))),
-        Dictionary(Box::new(DataType::UInt32), Box::new(Decimal256(76, 0))),
-    ]
+    ];
+
+    let dictionary_key_types =
+        vec![Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64];
+
+    let mut dictionary_types = dictionary_key_types
+        .into_iter()
+        .flat_map(|key_type| {
+            vec![
+                Dictionary(Box::new(key_type.clone()), Box::new(Int32)),
+                Dictionary(Box::new(key_type.clone()), Box::new(Utf8)),

Review Comment:
   Could we maybe try LargeUtf8 and LargeBinary as well?



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