alamb opened a new issue, #10920:
URL: https://github.com/apache/datafusion/issues/10920

   ### Is your feature request related to a problem or challenge?
   
   Part of https://github.com/apache/datafusion/issues/10918, 
`[StringViewArray`](https://docs.rs/arrow/latest/arrow/array/type.StringViewArray.html)
 support in DataFusion
   
   
   
https://datafusion.apache.org/user-guide/sql/scalar_functions.html#arrow-cast 
is a function widely used in DataFusion testing to test with specific arrow 
data types
   
   Under the covers it simply calls the appropriate arrow-cast kernel
   
   Here is an example showing how this works
   
   ```sql
   > select arrow_cast('foo', 'Dictionary(Int32, Utf8)');
   +---------------------------------------------------------+
   | arrow_cast(Utf8("foo"),Utf8("Dictionary(Int32, Utf8)")) |
   +---------------------------------------------------------+
   | foo                                                     |
   +---------------------------------------------------------+
   1 row(s) fetched.
   Elapsed 0.006 seconds.
   
   > select arrow_typeof(arrow_cast('foo', 'Dictionary(Int32, Utf8)'));
   +-----------------------------------------------------------------------+
   | arrow_typeof(arrow_cast(Utf8("foo"),Utf8("Dictionary(Int32, Utf8)"))) |
   +-----------------------------------------------------------------------+
   | Dictionary(Int32, Utf8)                                               |
   +-----------------------------------------------------------------------+
   1 row(s) fetched.
   Elapsed 0.001 seconds.
   ```
   
   here is how to make a table with dictionary encoded values:
   
   ```sql
   > create table foo as values ('Andrew', 'Xiangpeng', 'Raphael');
   0 row(s) fetched.
   Elapsed 0.002 seconds.
   
   > create table dict_table as select arrow_cast(column1, 'Dictionary(Int32, 
Utf8)') column1 from foo;
   0 row(s) fetched.
   Elapsed 0.008 seconds.
   
   > select column1, arrow_typeof(column1) from dict_table;
   +---------+----------------------------------+
   | column1 | arrow_typeof(dict_table.column1) |
   +---------+----------------------------------+
   | Andrew  | Dictionary(Int32, Utf8)          |
   +---------+----------------------------------+
   1 row(s) fetched.
   Elapsed 0.002 seconds.
   ```
   
   ### Describe the solution you'd like
   
   I would like to be able to use ArrowCast to create `StringView` and 
`BinaryView` arrays for testing
   
   This does not yet work:
   ```sql
   > select arrow_cast('foo', 'StringView');
   Error during planning: Unsupported type 'StringView'. Must be a supported 
arrow type name such as 'Int32' or 'Timestamp(Nanosecond, None)'. Error 
unrecognized word: StringView
   ```
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to