在上面的例子中,整个SQL表达式的执行过程
表达式要先分解,分解成转置,fill,和reduce三个步骤。
- last(price)是转置前每个单元格的值
- fill的输入是转置后的一个列
- reduce的输入是转置以及fill后的所有列
所以last(price)不是fill的直接输入
示例代码如下:
symbol = take(`APPL, 6) join take(`FB, 5) time = 2019.02.27T09:45:01 2019.02.27T09:45:01 2019.02.27T09:45:04 2019.02.27T09:45:04 2019.02.27T09:45:05 2019.02.27T09:45:06 2019.02.27T09:45:01 2019.02.27T09:45:02 2019.02.27T09:45:03 2019.02.27T09:45:04 2019.02.27T09:45:05 price = (170 + rand(5, 6)) join (64 + rand(2, 5)) quotes = table(symbol, time, price) weights = dict(`APPL`FB, 0.6 0.4) ETF = select symbol, time, price * weights[symbol] as price from quotes t = select rowSum(ffill(last(price))) from ETF pivot by time, symbol
请问,上述的select rowSum(ffill(last(price))) from ETF pivot by time, symbol具体执行流程是怎么样的?
在上面的例子中,整个SQL表达式的执行过程
表达式要先分解,分解成转置,fill,和reduce三个步骤。
所以last(price)不是fill的直接输入