Mixed types are not supported as returned values over JDBC, ODBC and Flight connections

I am trying to query data stored as parquet file. When I make the query from the dremio ui everithing works fine. When I make the same query with JDBC driver I get this error:

Mixed types are not supported as returned values over JDBC, ODBC and Flight connections. Cast "<field>.$data$" to a primitive data type either in the select statement or the VDS definition.

The <field> is of type integer array and could be empty.

I can’t understand why with the ui there is no problem.

@stefano.castoldi

Dremio deprecated mixed types in 4.0, when going via the ODBC path, there was code compilation error that we are no suppressing and giving an unsupported message

I can’t understand! Starting from version 4.0 I can’t use an array as type or mixed empty and not empty array?

There is no way to renable mixed types?

@stefano.castoldi

Are you able to provide the profile of the query running from UI and JDBC?

Query profile from the UI

e9ad384b-64bb-4469-bf3e-ac5ff0ea163c.zip (11,5 KB)

Query Profile from JDBC:

07d4b3dc-4984-4a0a-97e6-cc7b135838ed.zip (8,4 KB)

@stefano.castoldi

Here is the issue, there is an array “thresholds” and an item “data” inside is, if you see Dremio mark the ARRAY as “ANY ARRAY thresholds” which means data has mixed types. We still (although deprecated) allow mixed types but not via ODBC. The workaround for you is to CAST data to a certain datatype and save as VDS, then query the VDS via ODBC or JDBC or Flight

Thanks
Bali

Thats is clear, but actually make a CAAST could be a problem.I can’t understand why other tables derived from parquet files with the same structure works fine. Maybe could be the problem in the parquet files?

@stefano.castoldi

Yes, most like there is a schema change between 2 Parquet files under the same folder

Thanks
Bali