Hi,
I'm a new comer with some questions about basic conceptions of MonetDB.
1. The executor
I've ever found the executor of postgreSQL at src\backend\executor,
but cannot make sure where it is like that in MonetDB src.
MonetDB\MonetDB\src\gdk or MonetDB5-server\MonetDB5\src\mal ?
3. MAL
MAL (MonetDB Assembly Language) is a script tool only for MonetDB or
a common script language that can be applied to other softwares.
Why it is a must in MonetDB ?
4. .mx files
In MonetDB, .mx files are compiled to make .h and .c files generated.(in
this way ?)
Why is this routines ? (not just coding in .h and .c files directly)
Yel
----
Best Regards
richardroky(a)gmail.com
Hey Gijs,
I'm seeing a difference in how MonetDB and SQLite
handle transactions inside Django.
Here's my current unit test in Django (it passes w/
SQLite and fails with MonetDB):
1 : s1 = Simple(name="mark")
2 : s1.save()
3 :
4 : s2 = Simple(name="mark")
5 : try:
6 : s2.save()
7 : except IntegrityError:
8 : pass
9 :
10 : s = Simple.objects.get(name="mark")
11 : print s
What happens under SQLite is the save on line 6
fails, but the select on line 10 works.
In MonetDB, at line 10, I get the error
current transaction is aborted
(please ROLLBACK)
Here's the trace of mapi2 commands, starting
from line 2
mapi2.py, cmd, operation = sINSERT INTO "testapp_simple" ("name")
VALUES ('mark');
mapi2.py, cmd, operation = Xreply_size 1
mapi2.py, cmd, operation = sCOMMIT;
mapi2.py, cmd, operation = Xreply_size 1000
mapi2.py, cmd, operation = sINSERT INTO "testapp_simple" ("name")
VALUES ('mark');
mapi2.py, cmd, operation = Xreply_size 1000
mapi2.py, cmd, operation = sSELECT "testapp_simple"."id",
"testapp_simple"."name" FROM "testapp_simple" WHERE
"testapp_simple"."name" = 'mark' ;
mapi2.py, cmd, operation = Xreply_size 1
mapi2.py, cmd, operation = sROLLBACK;
It looks like the ROLLBACK isn't executed until the
connection closes.
With auto commit off, shouldn't the ROLLBACK fire
as soon as the insert fails?
If so, how do I fix this?
Thanks
m
Hi,
I'm working on the Django adapter again, and have
run into a snag. I think the Python MonetDB wrapper
may need a new method, but before building a patch
I wanted to share the idea and get your feedback.
The issue is this: Django uses the field type SafeUnicode.
Monetizer doesn't have a mapping for this, and thus
raises a ProgrammerError exception. (This is unicode
that is safe to disply on an HTML page, and is used for
all slug fields, which are common in Django.)
The SQLite adapter handles this via a register_adapter
method on the Database object. PostgreSQL uses
psycopg2.extensions.register_adapter().
MySQL Python adapter exposes a encoders() method
on the connection object.
It seems the cleanest solution would be to mimic
SQLite (if you want this for one connection, you most
likely want it for all connections), and be able to do
something like this:
Database.register_adapter(
type(SafeUnicode),
lambda s:unicode(s)
)
But it wasn't clear to me how to implement this. Somehow
that call needs to make it into Montizer mapping dictionary.
Thanks,
Mark
Any chance the Python client could be modified to
return strings in Unicode instead of UTF-8?
Seems like a better fit for Python; for example,
that's how Python's sqlite3 module behaves.
An alternative approach is to expose a set_encoding
method on the connection that let's you specify the
encoding of all text fields returned.
If backward compatibility is an issue, the latter idea
seems better even though it adds a knob.
Any comments?
(Is the maintainer of the Python adapter active even
on this list? I didn't see many Python-specific posts
in the archives.)
Thanks,
m
Hello Everyone,
Is there any way to specify a null value when using ODBC param_query, in
case of SQL_Query we do not really end up facing this problem as we build
our own query string and then execute sql_query, sql_query is potentially
unsafe of sql injection attacks, and thus using param_query makes alot of
sense, but param query makes it hard to specify the data type nuetral NULL
value, if we try specifying blank values like 0 in case of number and "" in
case of string, these blank values will end up taking space in the database
and thus would be expensive in terms of memory consumption, a database
specific NULL value would leave the field null with no memory consumption.
Thank you everyone in advance.
kss ram
Hello Everyone!
Brief Overview of the issue
1. Sample Data that erlang program tries to insert in monetdb
{data,
[{"a","string"}, {"b","string"}], %% a,b are column names
[
[{"a","a1"}, {"b","b1"}], %% key, value pair of the data - {columnname,
data}
[{"a","a2"}, {"b","b2"}],
[{"a","a3"}, {"b","b3"}],
[{"a","a4"}, {"b","b4"}],
[{"a","a5"}, {"b","b5"}],
[{"a","a6"}, {"b","b6"}],
[{"a","a7"}, {"b","b7"}],
[{"a","a8"}, {"b","b8"}],
[{"a","a9"}, {"b","b9"}],
[{"a","a10"}, {"b","b10"}],
[{"a","a11"}, {"b","b11"}]
],
{"no_of_records","12"}
}
2. no of threads/processes that would do parallel inserts would be
determined by the thread size i.e how many of records the thread would
insert, if say 5 records then 3 threads, if 3 records then 4 threads.
3. in order to connect to monetdb from erlang, the monetdb ODBC driver is
specified in ODBCConfig utility of ubuntu, driver file is
/usr/lib/libMonetODBC.so
4. threads are successfully created and the ODBC module quits successfully
after inserting in the erlang program, but when we look in the monetdb
table, some of the rows get missed, for example row from 1 to 11 get
inserted without row 3 or 4 getting inserted.
could this be a problem with the ODBC driver?, am I missing any
configuration?, any help would be deeply appreciated.
Thank you,
Ram.
Why not fix this "properly" by changing the type of cnt (and the
function return value and several other variables)?
At the very least you could have an assert to check that the value fits
in an int.
On 2010-06-10 10:54, Fabian Groffen wrote:
> Changeset: 820a7637cf5e for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=820a7637cf5e
> Modified Files:
> MonetDB5/src/optimizer/opt_mapreduce.mx
> Branch: default
> Log Message:
>
> fix compilation failure opt_mapreduce.mx:141: '=' : conversion from 'size_t' to 'int', possible loss of data
>
>
> diffs (12 lines):
>
> diff -r c7d1cd0d0bbb -r 820a7637cf5e MonetDB5/src/optimizer/opt_mapreduce.mx
> --- a/MonetDB5/src/optimizer/opt_mapreduce.mx Wed Jun 09 15:30:45 2010 +0200
> +++ b/MonetDB5/src/optimizer/opt_mapreduce.mx Thu Jun 10 10:54:23 2010 +0200
> @@ -138,7 +138,7 @@
> return 0;
> }
> cloud = BATdescriptor(bid);
> - cnt = BATcount(cloud);
> + cnt = (int)BATcount(cloud);
> BBPreleaseref(bid); /* we're done with it */
> return(cnt);
> }
> _______________________________________________
> Checkin-list mailing list
> Checkin-list(a)monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
--
Sjoerd Mullender