dynamobi/dynamobi — Issue #468: [FNL-40] Add POINTER datatype to Fennel calculator
Author: dynamobi-build
Created: 2011-12-30 03:28:23+00:00
State: open
Labels: Calc, FNL

[reporter="jhyde", created="Sun, 18 Jun 2006 15:51:13 -0500 (GMT-05:00)"]
Add a POINTER datatype to Fennel calculator.

We need this in our support for rolling min/max. Consider the query

select min(sal) over previous10Hires,

avg(sal) over previous10Hires

from emps

window previous10Hires as (order by hiredate partition by deptno rows 10 preceding)

The 'bucket' maintained for each department consists of a sum and count (to compute avg) and a pointer to a histogram (containing a btree of all salary values seen). We have to keep the histogram on the heap because its size is unbounded. (Yes, we could switch to an algorithm using external sorts but we don't want to.)

Currently we use an INT32 field to represent the pointer. This will fail on 64 bit architectures and even on 32 bit architectures pointers may have different alignment requirements than INT32.