我有两个连续观点:tikets2
和second_view
CREATE CONTINUOUS VIEW tickets2 AS
SELECT ticketid,
TO_TIMESTAMP(min(event_time)::double precision /1000000) as t0,
keyed_min(event_time, status) as t0_status,
TO_TIMESTAMP(max(event_time)::double precision /1000000) as tc,
keyed_max(event_time, status) as tc_status
FROM tickets_stream2
group by ticketid;
CREATE CONTINUOUS VIEW second_view AS
SELECT (new).tc FROM output_of('tickets2’);
当我将数据插入tickets_stream2
时,我收到一个断言错误。
TRAP:FailedAssertion(“!(ActiveSnapshotSet())”,文件:“postgres.c”, 行:824,PID:5275,查询:ticket2)
删除second_view
,数据插入tickets_stream2
执行时没有问题。
我无法弄清楚我错过了什么。
OB的。我正在使用PipelineDB 0.9.7
编辑:
同时我尝试了没有TO_TIMESTAMP()函数并且没有发生异常。
CREATE CONTINUOUS VIEW tickets2 AS
SELECT
ticketid,
min(event_time) as t0,
keyed_min(event_time, status) as t0_status,
max(event_time) as tc,
keyed_max(event_time, status) as tc_status
FROM tickets_stream_test_output
GROUP BY ticketid;
编辑2,0.9.7u3 (可能对其他人有用)
我测试了更新版本。我不再让断言失败,但是当我将数据插入test_version_stream时仍然会发生错误。
CREATE STREAM test_version_stream(event_time bigint, ticketid uuid, status text);
CREATE CONTINUOUS VIEW test_version_view AS
SELECT ticketid,
TO_TIMESTAMP(min(event_time)::double precision /1000000) as t
FROM test_version_stream
GROUP BY ticketid;
CREATE CONTINUOUS VIEW e_test_version_view AS
SELECT (new).t FROM output_of('test_version_view');
我改变了函数min
和to_timestamp
的顺序,一切顺利:)