comphead commented on PR #17376:
URL: https://github.com/apache/datafusion/pull/17376#issuecomment-3247239792

   > > Thanks @parthchandra please check if proposed method description is 
accurate enough
   > 
   > Shouldn't that be -
   > 
   > ```
   > /// # Input
   > /// ["alice", "bob", "alice", null, "carol"]
   > /// 
   > /// # Output
   > /// DictionaryArray<Int32>
   > /// {
   > ///   keys:   [0, 1, 0, null, 2],
   > ///   values: ["alice", "bob", "carol"]
   > /// }
   > ```
   
   I dont think so, as there is no dict conversions, just a loop, but I ran a 
test
   
   ```
       #[test]
       fn test_dict_from_values_with_strings() {
           let values = Arc::new(StringArray::from(vec!["a", "b", "a", "c"])) 
as ArrayRef;
           let dict = dict_from_values::<Int32Type>(values).unwrap();
           dbg!(&dict);
       }
   
   [datafusion/common/src/scalar/mod.rs:7650:9] &dict = DictionaryArray {keys: 
PrimitiveArray<Int32>
   [
     0,
     1,
     2,
     3,
   ] values: StringArray
   [
     "a",
     "b",
     "a",
     "c",
   ]}
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to