monetdbmonetdb-assembly-language

How to implement SUM aggregation for strings


We're using MonetDB to implemnent an idea. For our purposes we need to implement the SUM Aggregation for Strings. My first step in trying to realize it was to just add a sum pattern in the mal files that define these patterns for the other datatypes. Then I tried to pinpoint the exact point where the list of possible implementations is compared with the input datatype but I'm making slow progress.

  1. Where/how are mal files evaluated?
  2. How to go about adding own sum command/pattern so that string data reaches the sum function without MonetDB trying to convert it to bte?

Solution

  • As of Oct2020 release, MAL files are integrated into the C source code, hence, MAL files are no longer used. The MAL files are in the source code repository for documentation purpose only and once that information has been moved to proper places, the MAL files will be gradually removed.

    If you want to implement your own function, please have a look at the examples in this repository: https://dev.monetdb.org/hg/MonetDB-extend You can clone it using hg clone https://dev.monetdb.org/hg/MonetDB-extend

    I'm not sure how up-to-date this repository now is => depends on which MonetDB version you're using. If you have problems with those examples, please open new tickets in https://github.com/monetdb/monetdb/issues