b and g must be aligned

Sjoerd Mullender sjoerd at acm.org
Thu Jul 25 14:51:19 CEST 2013

Hash: SHA1

On 2013-07-25 14:04, Miguel Ping wrote:
> Hi all,
> We're hitting this error "b and g must be aligned". I tracked the
> src to a commit about some alignment code thing in gdk_calc: 
> http://www.mail-archive.com/checkin-list@monetdb.org/msg09731.html
> (Fix alignment conversion in compatibility code for grouped
> aggregates.)
> Can you guys please explain what's the reason behind this error? I
> can't understand by just looking to the src of gdk_calc.c
> Thanks!

When using grouped aggregates, the grouping bat must be aligned with
the value bat.  The value bat is b and contains the values you want to
aggregate.  The group bat is g and contains for each value in b the
group (an oid) it belongs to.  Equal group ids means the same group.
These bats must be aligned, because we need to know for each value in
b to which group it belongs.
Aligned means: same length, and same head column values.  The head
columns must be dense (a sequence of numbers starting at some value,
and each next value exactly one larger than the previous).  Dense
sequences are usually not stored explicitly in MonetDB.  We only store
the first value in the hseqbase field.  So the hseqbase fields of b
and g must be equal.  The one exception to this is when the bats are
both empty.  This last exception is the change to gdk_calc.c in that

- -- 
Sjoerd Mullender
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the users-list mailing list