Dashbuilder OData Provider

48 views
Skip to first unread message

Hugo Guerrero

unread,
Sep 30, 2016, 10:13:22 AM9/30/16
to Dashbuilder Development
Hi all

I'm developing a custom dashbuilder data provider for OData, The project started when looking for a replacement of Kibana for log data visualization. We are using apache camel for collecting logs, infinispan for data storage, and we wanted to add dashbuilder for visualizations. 

At the beginning we had to change the infinispan aproach as they don't have native json querying, but we found the infinispan-odata-server[1] from Tomas to be very handy to implement a simple OData interfase, so we updated it to version 4.0[2]. Also, it's easier to develop a dashbuilder connector for querying OData services rather than infinispan remote queries. 

Prototype for Odata provider is starting to take form. Now it works only retrieving very specific data (the needed for my integration) and I have found a couple of issues I would like help on:

Metadata

+ what is it suppossed to return ? The metadata test is failing as I have no idea what's the relation between the lookedup data and the metadata.

Webapp

+ I get an error of not able to use a string to generate graphs, for example how many records for especifc column. Table format displays ok, but fails when trying to use aggregate functions.

Query

+ Whats the correct way to deal with filters and columns?

Thanks in advance!

Regards,

Hugo Guerrero


David Gutiérrez

unread,
Sep 30, 2016, 11:05:22 AM9/30/16
to Hugo Guerrero, Dashbuilder Development
Very interesting stuff!

See my answers below....

>Metadata
>
>+ what is it suppossed to return ? The metadata test is failing as I have
>no idea what's the relation between the lookedup data and the metadata.

The metadata is required by the dashbuilder engine in order to know a bit of information in advance about the dataset.

In the case of the SQL provider for example, the metadata calculation is done by executing an SQL with max(rowcount)=1 (either the custom SQL provided or the  DB table specified). That SQL returns 1-row result set containing the dataset columns & its types: https://github.com/dashbuilder/dashbuilder/blob/master/dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/SQLDataSetProvider.java#L305

What you basically need to do, is something similar. Do whatever it takes to do to figure out the dataset def columuns ist types, the number of rows in the dataset and the estimated size. All this info must be returned in a DataSetMetadata instance that you must create.

>Webapp
>
>+ I get an error of not able to use a string to generate graphs, for
>example how many records for especifc column. Table format displays ok, but
>fails when trying to use aggregate functions.

Every displayer expects a dataset structure. Pie charts, for instance,  require a 2-columns dataset, first column a label, and second a number.

Notice, every time you switch to a pie chart, for instance, you receive a lookup call in your provider. If you debug and inspect this DataSetLookup instance you will see is asking for exactly this 2 columns dataset. If the dataset returned is not as expected an error is shown.

Each displayer declares its lookup constraints (including the supported dataset structures). 


Anyway, what you have to do is to be able to support all the possible DataSetLookup calls that can be passed through your provider.

We do have a complete battery of tests that guarantee every provider we implement support all the use cases. We can take later on about providing those unit tests.


>Query
>
>+ Whats the correct way to deal with filters and columns?

I'm not sure I understand this. Are you talking about how to support a DataSetLookup's filter and columns operations?

If so, those operations are part of the DataSetLookup instance, which basically tells the provider "what" to retrieve.


Hope it helps, 

- David - 

--
You received this message because you are subscribed to the Google Groups "Dashbuilder Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dashbuilder-development+unsub...@googlegroups.com.
To post to this group, send email to dashbuilder-development@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dashbuilder-development/c583a066-44ec-4efa-92fc-57d5ede8ff33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages