Slide 33
Slide 33 text
33
CREATE TABLE IF NOT EXISTS “doc”.“readings” (
“ts” TIMESTAMP WITH TIME ZONE,
“name” TEXT,
“device_id” TEXT,
“data” ARRAY(INTEGER)
)
• CrateDB supports arrays, including arrays of objects
• Several measurements can be stored in a single row
“data” : [21, 20, 23, 21, 19, 18, 24]
Arrays
Extract values from arrays:
SELECT data[1] FROM readings
SELECT data[1:100] FROM readings