jayzhan211 opened a new issue, #10207:
URL: https://github.com/apache/datafusion/issues/10207
### Is your feature request related to a problem or challenge?
Currently we can build struct table like this
```
statement ok
create table t as values (struct(1, 'a')), (struct(2, 'b'));
query ?
select * from t;
----
{c0: 1, c1: a}
{c0: 2, c1: b}
```
If we want to name them, we need to build with `named_struct`
```
statement ok
create table t as values (named_struct('number', 1, 'varchar', 'a')),
(named_struct('number', 2, 'varchar', 'b'));
query ?
select * from t;
----
{number: 1, varchar: a}
{number: 2, varchar: b}
```
I hope we can build the struct table with pre-defined type and name
```
statement error DataFusion error: This feature is not implemented:
Unsupported SQL type Custom\(ObjectName\(\[Ident \{ value: "struct",
quote_style: None \}\]\), \["n", "int", "s", "varchar"\]\)
create table t (s struct(n int, s varchar)) as values (struct(1, 'a')),
(struct(2, 'b'));
query ?
select * from t;
----
{n: 1, s: a}
{n: 2, s: b}
```
### Describe the solution you'd like
_No response_
### 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]