cloudant - how to 'flatten' the table in dashDB created by the schema discovery process (SDP)? -
i've used cloudant schema discovery process (sdp) create , populate table in dashdb. data in cloudant time series in nature:
... { "date": "20150101t00:00:00", "type": "temperature", "reading": "21" } { "date": "20150101t00:00:00", "type": "windspeed", "reading": "15" } { "date": "20150101t00:00:10", "type": "airhumidity", "reading": "51" } { "date": "20150101t00:00:10", "type": "temperature", "reading": "22" } ...
when data pushed dashdb, maintains similar structure, i.e.
date | type | reading ------------------+---------------+--------- 20150101t00:00:00 | temperature | 21 20150101t00:00:00 | windspeed | 15 20150101t00:00:10 | airhumidity | 51 20150101t00:00:10 | temperature | 22
however, data in 'flatter' structure, i.e.
date | temperature | windspeed | airhumidity ------------------+---------------+--------------+------------- 20150101t00:00:00 | 21 | 15 | - 20150101t00:00:10 | 22 | - | 51
how can flatten sdp populated data?
one option create bluemix service runs sql code on cron timer move data around desired structure.
see here example project using spring boot , groovy.
Comments
Post a Comment