Skip to content

Dremio

Dremio is an open source project that allows to explore and analyze data, regardless of its location, size, or structure. It supports several data sources behind it such as Elasticsearch, PostgreSQL, Oracle and others, that we can communicate to by using SQL.

To use the Dremio provider we need include the library:

1
<script src="./CFT-dremio-provider.min.js"></script>
1
2
3
4
5
6
7
8
// define providers
var providers = [{
    name:'Dremio',
    provider:'dremio',
    url:'http://localhost:9047',
    user: 'username',
    password: 'password'
}]

Then, as in with any other provider, use the setProviders() method of ChartFactor to set your data provider definitions:

1
cf.setProviders(providers);

This assumes you have a running instance with Dremio.

A significant part to mention is that Dremio handles the sources in a hierarchical format and it can be appreciated in how it builds queries. We must use that same way to specify the source name in the aql:

1
2
3
4
cf.provider('Dremio')
.source('"Source Name"."path.to".source')
.groupby(...)
...

Supported Aggregations Out-Of-The-Box

SUM

1
    var metric = cf.Metric("amount","sum");

AVG

1
    var metric = cf.Metric("amount","avg");

MIN

1
    var metric = cf.Metric("amount","min");

MAX

1
    var metric = cf.Metric("amount","max");

COUNT DISTINCT

1
    var metric = cf.Metric("my_attribute","unique");

Dependencies

  • None