jayzhan211 opened a new issue, #13408:
URL: https://github.com/apache/datafusion/issues/13408
### Is your feature request related to a problem or challenge?
This is the simplest way to create a string column
```
statement ok
create table t(a varchar) as values ('1'), ('2');
query T
select arrow_typeof(a) from t;
----
Utf8
Utf8
statement ok
drop table t
```
I'm finding a simple way to create `Utf8View` column. We can achieve this
with casting (See `datafusion/sqllogictest/test_files/string/string_view.slt`)
but I think we can have a more simpler way to do this.
### Describe the solution you'd like
I have two idea but not sure which one is better
# Approach 1
Set the configuration with `use_string_view = true`, and we will read the
column (`varchar`) as string view type instead of string type.
Something like
```
set datafusion.xxx.use_string_view = true
statement ok
create table t(a varchar) as values ('1'), ('2');
query T
select arrow_typeof(a) from t;
----
Utf8View
Utf8View
statement ok
drop table t
```
# Approach 2
introduce string_view syntax like `varchar_view` so we know we want to read
it as string view type
Something like
```
statement ok
create table t(a varchar_view) as values ('1'), ('2');
query T
select arrow_typeof(a) from t;
----
Utf8View
Utf8View
statement ok
drop table t
```
### 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: [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]