我使用 Cloudant 模式发现过程 (SDP) 在 dashDB 中创建和填充表。Cloudant 中的数据本质上是时间序列:
...
{ "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" }
...
当这些数据被推入dashDB时,它保持着类似的结构,即
DATE | TYPE | READING
------------------+---------------+---------
20150101T00:00:00 | temperature | 21
20150101T00:00:00 | windspeed | 15
20150101T00:00:10 | airhumidity | 51
20150101T00:00:10 | temperature | 22
但是,我希望这些数据采用“更扁平”的结构,即
DATE | TEMPERATURE | WINDSPEED | AIRHUMIDITY
------------------+---------------+--------------+-------------
20150101T00:00:00 | 21 | 15 | -
20150101T00:00:10 | 22 | - | 51
如何展平 SDP 填充数据?