External data atoms Issues

Mike Gomez mail_server at lavabit.com
Mon Mar 11 17:18:31 CET 2013

    i have been trying to expand data types (both core and external
atoms).However, after discussions, i understood that addition of core
data types will takes years( if i am not exaggerating).So, i started
testing up external gdk atoms (monetdb5/modules/atoms).

i am creating new atom type say mytype which is int based as below.
this atom is pure int ( there are no bitfields and so on)
typedef int mytype;
atom mytype:int; in mal

i have defined the following mal procedures( and C backends)
fromstr(), tostr(), mytype(s:str):mytype, new(s:str):mytype,

at this moment,it can successfully create tables and do selects.
however, selects are not working as they should.

these queries work.
create table test(i mytype);
insert into test values('453535');
select * from test

these don't work.
select * from test2 where i >= 5
above query gives error "types mytype(0,0) and tinyint(8,0) are not
equal for column 'i'"

insert into test2 values(453535);
gives types int(32,0) and mytype(0,0) are not equal

however, this query works !!!!!!
select * from test2 where i >= '1' 

after testing and too many code peeping for above query, i figured out
that the above query converts each element of table to string using
tostr, and then compares the strings, and takes decision.
so, it looks like there can be  performance improvements here.

However,my question is HOW do i get the queries working such as 
select * from test2 where i >= 5

am i missing something??

any pointers may be helpful.


More information about the developers-list mailing list