You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "viirya (via GitHub)" <gi...@apache.org> on 2023/02/28 17:57:16 UTC

[GitHub] [arrow-rs] viirya commented on a diff in pull request #3777: Creates PrimitiveDictionaryBuilder from provided keys and values builders

viirya commented on code in PR #3777:
URL: https://github.com/apache/arrow-rs/pull/3777#discussion_r1120538588


##########
arrow-array/src/builder/primitive_dictionary_builder.rs:
##########
@@ -113,6 +113,18 @@ where
         }
     }
 
+    /// Creates a new `PrimitiveDictionaryBuilder` from the provided keys and values builders.
+    pub fn new_from_builders(
+        keys_builder: PrimitiveBuilder<K>,
+        values_builder: PrimitiveBuilder<V>,
+    ) -> Self {
+        Self {
+            keys_builder,
+            values_builder,
+            map: HashMap::new(),

Review Comment:
   Added a panics condition to prevent it.



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