metabase-driver icon indicating copy to clipboard operation
metabase-driver copied to clipboard

Nested fields support

Open vprus opened this issue 3 years ago • 2 comments
trafficstars

I am using driver version 1.0.3 together with Trino 385, metabase 0.43 and delta. In delta we have a table with fairly nested schema. E.g. there's a column "device" with "os_type" field inside. In metabase, these columns end up with non-nested types.

The highlighted columns on the screenshots are both complex structures, not boolean or ints.

image

Is this something to be addressed on the driver side? From the metabase issues, such as https://github.com/metabase/metabase/issues/3173, it appears that it does not have perfect support for nested schemas, but at least some support for mongo - so the first step is the driver support.

vprus avatar Jun 16 '22 08:06 vprus

So, the approach would be similar to that of mongo's, where you would ecxpect to see something like: device.os_type?

andrewdibiasio6 avatar Jun 17 '22 13:06 andrewdibiasio6

I am not yet entirely sure how it works in Mongo. IIUC, it works by:

  • Mongo driver reporting field type as JSON
  • Metabase sampling the field values and inferring schema
  • Query building allowing to filter/group on the nested fields (at least https://github.com/metabase/metabase/pull/3738 claims that it works)

In case of Trino+Delta, it probably would be better to skip sampling of fields, since Delta knows the exact types, but getting feature parity with Mongo would be already awesome.

vprus avatar Jun 17 '22 14:06 vprus