Hi MonetDB developers and users,
sorry for this "blunt" posting, but I thought, the problem, respectively the
solution/recommendation that will hopefully be initiated by this question,
might be interesting for some more of you:
Triggered by a question from Agustin, I noticed that I (believe it or not
;-) apparently lack some knowledge of / experiences with MonetDB/MIL:
Consider you have a variable "a" holding a (possible transient) BAT, and
another variable "b" holding a second BAT, which …
[View More]happens to be a view of the
first one. Both BATs haven't been baptized ("rename()"), yet; hence they
still hold there default names:
var a := new(void,int).seqbase(0(a)0).insert(nil,1).insert(nil,2).access(BAT_READ);
var b := reverse(a);
print(a);
#-----------------#
# h tmp_29 # name
# void int # type
#-----------------#
[ 0@0, 1 ]
[ 1@0, 2 ]
print(b);
#-----------------#
# t tmp_29 # name
# int void # type
#-----------------#
[ 1, 0@0 ]
[ 2, 1@0 ]
Then, these BATs should be gathered in a "container"-BAT. Since (persistent)
nested BATs have disappeared (for good reasons!), we do this by gathering
the BAT's name in the container:
var c := new(void,str).seqbase(10@0);
c.insert(nil,bbpname(a)).insert(nil,bbpname(b));
print(c);
#-------------------------#
# h tmp_28 # name
# void str # type
#-------------------------#
[ 10@0, "tmp_29" ]
[ 11@0, "tmp_29" ]
Since the second BAT is only a view of the first one, they share not only
the same memory/storage, but also the same (bbp-)name; hence, they are not
distinguishable by (only) their (bbp-)names, and thus the container c actually
contains the first BAT twice iso each BAT once:
print(bat(fetch(c,0)));
#-----------------#
# h tmp_29 # name
# void int # type
#-----------------#
[ 0@0, 1 ]
[ 1@0, 2 ]
print(bat(fetch(c,1)));
#-----------------#
# h tmp_29 # name
# void int # type
#-----------------#
[ 0@0, 1 ]
[ 1@0, 2 ]
print(bbpname(a));
[ "tmp_29" ]
print(bbpname(b));
[ "tmp_29" ]
Obviously, the problem can be solved/avoided by baptizing the two BATs, and
hence making them unique "individuals":
rename(a,"BAT_a");
rename(b,"BAT_b");
print(bbpname(a));
[ "BAT_a" ]
print(bbpname(b));
[ "BAT_b" ]
c.insert(nil,bbpname(a)).insert(nil,bbpname(b));
print(c);
#-------------------------#
# h tmp_28 # name
# void str # type
#-------------------------#
[ 10@0, "tmp_29" ]
[ 11@0, "tmp_29" ]
[ 12@0, "BAT_a" ]
[ 13@0, "BAT_b" ]
print(bat(fetch(c,0)));
!ERROR: interpret_params: print(param 1): invalid BAT.
print(bat(fetch(c,1)));
!ERROR: interpret_params: print(param 1): invalid BAT.
print(bat(fetch(c,2)));
#-----------------#
# h BAT_b # name
# void int # type
#-----------------#
[ 0@0, 1 ]
[ 1@0, 2 ]
print(bat(fetch(c,3)));
#-----------------#
# t BAT_b # name
# int void # type
#-----------------#
[ 1, 0@0 ]
[ 2, 1@0 ]
My question is now:
- Is this the only solution, or am I just not aware of another command iso
bbpname() that would return unique "default" name for non-renamed view?
Of course, given the fact that only MonetDB itself has control over the
default "tmp_*" names, it is always recommendable to assign names that you
can control yourself, whenever you use a BAT's name as its only reference...
Stefan
--
| Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl |
| CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ |
| 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 |
| The Netherlands | Fax : +31 (20) 592-4312 |
[View Less]
Dear Monet users and developers,
I installed Monet on Windows XP using MonetDB-Installer-4.4.0.zip
But there is no user documentation!
I took the default directory "c:\program files\CWI\MonetDB"
and looked in and below it -- but did not see any documentation.
I want to know the basics, e.g. how to create a table in SQL, populate
it, and query it.
OI am guessing that a statement ends with a semicolon, but do not know
even this.
I am guessing that it accepts standard SQL, but that s not clear …
[View More]either.
I am able to run the Server, and the Client, and the Mknife tool.
I tried a few ways in the Mknife tool, but without success.
For example in the SQL client tool I entered
sql>create table t (i integer);
And got back the message:
# 6 # querytype
I assume this is some kind of error.
Here is some more of my attempts to do something. Why are the values
for token number much
higher than the number of tokens in my statement?
sql>create tabel t (c char(1))
more>/
more>;
MAPI = monetdb@localhost:45123
QUERY = create tabel t (c char(1))
ERROR = !ERROR parse error at token (258) in statement: create tabel
sql>create table t (c char(1));
MAPI = monetdb@localhost:45123
QUERY = create table t (c char(1));
ERROR = !current transaction is aborted (please ROLLBACK)
sql>rollback
more>create table t (c char(1));
MAPI = monetdb@localhost:45123
QUERY = rollback
ERROR = !ERROR parse error at token (372) in statement: rollback
!create
sql>rollback;
# 7 # querytype
sql>rollback
more>/
more>;
MAPI = monetdb@localhost:45123
QUERY = rollback
ERROR = !ERROR parse error at token (47) in statement: rollback
!/
sql>rollback
more>;
# 7 # querytype
sql>ROLLBACK;
# 7 # querytype
sql>
I then tried looking for the documentation in MonetDB-4.4.0.tar.gz
But this explains how to compile the system, not how to use it.
I think there may be user documentation in the *.rpm files intended for
Linux,
but I do think I can use those on Windows.
Hopefully helpfully yours,
Steve
--
Steve Tolkin Steve . Tolkin at FMR dot COM 617-563-0516
Fidelity Investments 82 Devonshire St. V4D Boston MA 02109
There is nothing so practical as a good theory. Comments are by me,
not Fidelity Investments, its subsidiaries or affiliates.
[View Less]