Search code examples
duckdb

DuckDb error message when querying structure with * in SQL


select field.a.b from table_parquet returns a result with a structure when select field.a.b.* from table_parquet returns the following error:

SQL Error: java.sql.SQLException: Parser Error: syntax error at or near "*"

Using DbEaver with DuckDB v1.1.3 for the server and DuckDBJ 1.0 for the driver. Same behaviour from Java with

<dependency>
   <groupId>org.duckdb</groupId>
   <artifactId>duckdb_jdbc\</artifactId>
   <version>1.1.3\</version>
</dependency>

The table is a view mapped on a parquet file :

create or replace view table_parquet as select * from read_parquet('C:/temp/ASM/archives/*/*/*/*.parquet', hive_partitioning = true)

Is there any way to use *?

The query select field.a.b.* from table_parquet should return all fields of the structure b


Solution

  • Did you try

    select unnest(field.a.b) from table_parquet
    

    I would try it in the CLI before trying in Dbeaver. Is there a reason you are using an older duckdb version?