The aggregate functions for temporal cells are illustrated next.
Temporal count
tCount(tcell) → {tintSeq,tintSeqSet}
SELECT tCount(temp) FROM (VALUES (th3index '831c02fffffffff@2001-01-01')) AS t(temp);
-- {1@2001-01-01}
SELECT tCount(temp) FROM (VALUES (tquadbin '48a6227affffffff@2001-01-01')) AS t(temp);
-- {1@2001-01-01}
SELECT tCount(temp) FROM (VALUES (ts2cell '47c3c@2001-01-01')) AS t(temp);
-- {1@2001-01-01}
Window count
wCount(tcell) → {tintSeq,tintSeqSet}
SELECT wCount(temp, interval '1 day') FROM (VALUES
(th3index '831c02fffffffff@2001-01-01')) AS t(temp);
-- {[1@2001-01-01, 1@2001-01-02]}
SELECT wCount(temp, interval '1 day') FROM (VALUES
(tquadbin '48a6227affffffff@2001-01-01')) AS t(temp);
-- {[1@2001-01-01, 1@2001-01-02]}
SELECT wCount(temp, interval '1 day') FROM (VALUES
(ts2cell '47c3c@2001-01-01')) AS t(temp);
-- {[1@2001-01-01, 1@2001-01-02]}
Aggregate a set of temporal cells by merging them, or by assembling them into a sequence or a sequence set
merge(tcell) → tcell appendInstant(tcell[,interp text[,maxt interval]]) → tcell appendSequence(tcell) → tcell
DuckDB, Apache Spark and Apache Flink call them mergeAgg, appendInstantAgg and appendSequenceAgg (the section called “Names the Engines Own”).
SELECT merge(temp) FROM (VALUES (th3index '831c02fffffffff@2001-01-01')) AS t(temp);
-- {831c02fffffffff@2001-01-01}
SELECT merge(temp) FROM (VALUES (tquadbin '48a6227affffffff@2001-01-01')) AS t(temp);
-- {48a6227affffffff@2001-01-01}
SELECT merge(temp) FROM (VALUES (ts2cell '47c3c@2001-01-01')) AS t(temp);
-- {47c3c@2001-01-01}