Extension Function with TEXT ENCODING column argument



I’m looking to create an extension function that can accept the value of a table column of data type TEXT ENCODING NONE as an argument.

So I tried the following:

Character array:

double somefun(const char* xText) { ...

Character array with size (as per arrays discussed in header):

double somefun(const char* xText, const size_t elem_count) { ...

Character array with size as 32 bit int (as per char_length function signature):

double somefun(const char* xText, const int32_t elem_count) { ...

All three compile but I get a core dump when starting the MapD server.

Am I barking up the wrong tree? Any help appreciated.



There is no mechanism for you to add extension functions for a non dictionary encoded field.,

Can you describe a little more around your use case so we can help prioritize any changes that would be required



@dwayneberry thanks for the info.

I can maybe get away with using DICT encoded text, although it may create unnecessary overhead (depending on how MapD handles is behind the scenes). The actual use case involves base64 encoded strings which are used to represent an N-dimensional vector. (So we could model is as an array of INTEGERs, as an alternative).

In the case of DICT encoded strings, would one of the three approaches I tried work?


OK, so it isn’t actually a text string at all, but rather an array of ints that you’re jamming into a string. Probably this does belong in an array, and as noted in your separate post your question should be more along the line of how to create extension functions on arrays. Expect some more dev input on that later today.


Yep, thanks Bill. I’m just looking at the parse code to see if the array handling is something I can contrib.