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


##########
arrow-array/src/array/dictionary_array.rs:
##########
@@ -15,20 +15,130 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::array::{ArrayAccessor, ArrayIter};
+use crate::builder::StringDictionaryBuilder;
+use crate::iterator::ArrayIter;
+use crate::types::*;
+use crate::{
+    make_array, Array, ArrayAccessor, ArrayRef, ArrowPrimitiveType, 
PrimitiveArray,
+    StringArray,
+};
+use arrow_buffer::ArrowNativeType;
+use arrow_data::ArrayData;
+use arrow_schema::{ArrowError, DataType};
 use std::any::Any;
-use std::fmt;
-use std::iter::IntoIterator;
-use std::{convert::From, iter::FromIterator};
 
-use super::{
-    make_array, Array, ArrayData, ArrayRef, PrimitiveArray, StringArray,
-    StringDictionaryBuilder,
-};
-use crate::datatypes::{
-    ArrowDictionaryKeyType, ArrowNativeType, ArrowPrimitiveType, DataType,
-};
-use crate::error::Result;
+///
+/// A dictionary array where each element is a single value indexed by an 
integer key.
+///
+/// # Example: Using `collect`
+/// ```
+/// # use arrow_array::{Array, Int8DictionaryArray, Int8Array, StringArray};
+/// # use std::sync::Arc;
+///
+/// let array: Int8DictionaryArray = vec!["a", "a", "b", 
"c"].into_iter().collect();
+/// let values: Arc<dyn Array> = Arc::new(StringArray::from(vec!["a", "b", 
"c"]));
+/// assert_eq!(array.keys(), &Int8Array::from(vec![0, 0, 1, 2]));
+/// assert_eq!(array.values(), &values);
+/// ```
+pub type Int8DictionaryArray = DictionaryArray<Int8Type>;

Review Comment:
   Nope https://docs.rs/arrow/latest/arrow/array/type.Int8DictionaryArray.html



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to