Extension Function with TEXT ENCODING column argument


#1

Hi,

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:

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

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

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

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

EXTENSION_NOINLINE
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.


#2

Hi

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

Regards


#3

@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?


#4

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.


#5

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