[
https://issues.apache.org/jira/browse/CALCITE-3780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17199099#comment-17199099
]
Vladimir Sitnikov commented on CALCITE-3780:
--------------------------------------------
Thanks.
I've got a couple of more questions:
1) is {{org.apache.calcite.adapter.enumerable.EnumUtils.HopEnumerator#current}}
always non-nullable?
It is not clear if always produces a non-null result since {{for}} loop look
like it can be empty (however, it is not clear).
{code:java}
} else {
Object[] current = inputEnumerator.current();
List<Pair> windows =
hopWindows(SqlFunctions.toLong(current[indexOfWatermarkedColumn]),
emitFrequency, windowSize, offset);
for (Pair window : windows) {
Object[] curWithWindow = new Object[current.length + 2];
System.arraycopy(current, 0, curWithWindow, 0, current.length);
curWithWindow[current.length] = window.left;
curWithWindow[current.length + 1] = window.right;
list.offer(curWithWindow);
}
return takeOne();
}
{code}
2) Should {{org.apache.calcite.adapter.enumerable.EnumUtils#hopWindows}} use
{{Math.floorDiv(sizeMillis, periodMillis)}} rather than
{{Math.toIntExact(sizeMillis / periodMillis)}} ?
> SESSION Table-valued Function
> -----------------------------
>
> Key: CALCITE-3780
> URL: https://issues.apache.org/jira/browse/CALCITE-3780
> Project: Calcite
> Issue Type: Sub-task
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Fix For: 1.23.0
>
>
> We can create SESSION table-valued function to replace GROUP BY SESSION for
> inactive gap session functionality:
> {code:sql}
> SELECT *
> FROM TABLE SESSION (
> data => TABLE Bid ,
> timecol => DESCRIPTOR ( bidtime ) ,
> keycol => DESCRIPTOR(key),
> inactive_gap => INTERVAL '10' MINUTES )
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)