Adding data types (maybe to core), probably BUG
lsidir at gmail.com
Fri Mar 8 14:51:20 CET 2013
your second solution through the kernel is definitely not the right
way to go. Data types in the kernel are first class citizens and used
to optimize the code in many different ways. Adding a type there is
inefficient, next to impossible if you do not have years of experience
in monet, and 99.9% of the cases I can think of unnecessary.
The correct way to do it is through monetdb5/modules/atoms
But you have to expose the data type to the sql frontend too (I assume
that is what you are using).
Your uint must be mapped to a datatype that monetdb kernel knows and
has the same behaviour. That is oid's for this case (even if oid's may
be larger than uints).
MonetDB does not use function pointers for comparisons in the kernel,
so you can not just add another comparison function and expect
everything to work out of the box. Rather you map your new type in
monetdb5 to a type in the kernel that subsumes it.
Hope this helps.
On Fri, Mar 8, 2013 at 2:24 PM, Mike Gomez <mail_server at lavabit.com> wrote:
> i am working on monetdb so as it can be used efficiently by more
> users(myself included).However, the issue i seem to face ( as maybe
> others) is the data types.
> for many weeks now,I have been going through the source code,
> understanding and learning it.Data types in monetdb can be extended in 2
> types, external and core GDK.
> external method problem ( maybe bug in monetdb)
> I have created new data type, say unsigned int 32 bit, using extensions
> (such as inet,color and so on).However, the bug is monetdb
> system doesn't use my comparison operation, instead uses the default
> inbuilt operators.
> eg. in the uint mal file( MonetDB/monetdb5/modules/atoms/uint.mal), i
> have declared
> atom uint:int;
> ..............skipped source code
> however, when i sort the table, the system still places negative values
> ahead, means instead of using my declared comparison algos, it's
> using internal algos.
> my question is how do i override that ( or is it even possible to do
> core GDK method
> After failing that, i thought lets add the core data type uint in the
> gdk_atoms.c. i modified the parsor(& everything else) and the system
> recognizes my data type.
> however,when i run simple insert query such as below, i get
> insert into test1 values('2');
> TypeException:user.s1_1:'calc.uint' undefined in: _5:any :=
> however, i have got completely stuck in the MAL operators and language.
> so, how do i get the algebra, operations and everything right, so it
> Any pointers will help.
> let me know if something more is required.
> i am working on this out of my interest,so eventually if i get it to
> work somehow, the code goes back to project.
> Thanks for help.
> developers-list mailing list
> developers-list at monetdb.org
More information about the developers-list