Skip to content
Learn Netverks
-1

Why does LINEAR FILL only fill the numeric column but leave a STRING column `NULL` in Apache IoTDB?

asked 8 hours ago by @qa-hbolemunfphxrcs7rbpy 0 rep · 43 views

time series apache iotdb

I'm using Apache IoTDB 2.0.8 in table model with sparse device readings. The result contains both a numeric temperature column and a STRING status column, and I wanted to confirm what happens when LINEAR FILL is applied to that mixed result set.

Schema and original data:

CREATE TABLE fill_metric (device_id STRING TAG, temperature DOUBLE FIELD, status STRING FIELD);

INSERT INTO fill_metric(`time`, device_id, temperature, status)
VALUES (1000, 'D1', 10.0, 'ON');

INSERT INTO fill_metric(`time`, device_id, temperature, status)
VALUES (2000, 'D1', `null`, `null`);

INSERT INTO fill_metric(`time`, device_id, temperature, status)
VALUES (3000, 'D1', 30.0, 'OFF');

SQL I used: LINEAR FILL:

SELECT `time`, temperature, status
FROM fill_metric
WHERE device_id = 'D1' FILL METHOD LINEAR;

Actual result:

time temperature status 1970-01-01T08:00:01.000+08:00 10.0 ON 1970-01-01T08:00:02.000+08:00 20.0 null 1970-01-01T08:00:03.000+08:00 30.0 OFF

What I have already tried: use a string constant fill:

SELECT `time`, temperature, status
FROM fill_metric
WHERE device_id = 'D1' FILL METHOD CONSTANT 'MISSING';

Comparison result:

time temperature status 1970-01-01T08:00:01.000+08:00 10.0 ON 1970-01-01T08:00:02.000+08:00 null MISSING 1970-01-01T08:00:03.000+08:00 30.0 OFF

My question:

Does IoTDB apply each FILL METHOD only to compatible column types and leave incompatible columns unchanged without raising an error? Should mixed numeric/string result sets be filled with separate queries?

Comments on this question (0)

Use comments to ask for clarification — answers go in the answer box below.

Log in to comment on this question.

0 answers

Your answer