[MonetDB-users] How to print a BAT with MIL?
Dear all, I'm using MonetDB/XQuery. After i have added a few XML-files into MonetDB, i want to check out how their BATs looks like. /MonetDB>ls(); #---------------------------------------------------------------------------------------------------------------------------------# # name htype ttype count heat dirty status kind refcnt lrefcnt # # str str str lng int str str str int int # #---------------------------------------------------------------------------------------------------------------------------------# [ "1000000001_attr_own", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_prop", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_qn", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_frag_root", "oid", "oid", 1, 0, "clean", "disk", "pers", 0, 1 ] [ "1000000001_map_pid", "void", "oid", 1, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_nid_rid", "void", "oid", 25, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_com", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_ins", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ]/ *I get a list of BAT-data summary. But i cann't figure out how to use print functions from buildin module as listed:* / / 231 .COMMAND print(ANY value) = CMDprint_val; 232 "Print a MIL value between square brackets." 233 234 .COMMAND print(BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) = CMDprint_table; 235 "BATs are printed with '#' for legend lines, and the BUNs on seperate 236 lines between brackets, containing each to comma separated values 237 (head and tail). 238 If multiple BATs are passed for printing, print() performs an implicit 239 natural join, producing a multiattribute table." 240 241 .COMMAND print(INT order, BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) 242 = CMDprint_otable; 243 "The same as normal table print, but enforces to use the order of 244 BAT number [1..argc] to do the printing." 245 246 .COMMAND table(BAT[any::1,any], ...BAT[any::1,any]...) = print_table_default; 247 "Print an n-ary table. Like print(n-ary) but does not print oid column" 248 249 .COMMAND table(INT order, BAT[any::1,any], ...BAT[any::1,any]...) = print_table; 250 "Print an n-ary table. Use the ordering of param [1..argc]" 251 252 .COMMAND multitable(BAT[any,bat]) = CMDprint_multitable; 253 "Print an n-ary table contained within a BAT of BATs" 254 255 .COMMAND printf(str format, ...) = print_format; 256 "Print a formatted string on the standard client output." 257 258 .COMMAND sprintf(str format, ...) : str = print_str; 259 "Print a formatted string on the standard client output." 260 261 262 .END builtin; One single example may help me out of this trap. Best regards, Chaojing ------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/ §1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz). §2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen. §3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
Hi,
all the print functions that you list in your email are the same
function but overload with different types. What you have to simply do
is:
name_of_bat.print();
or
print(name_of_bat);
In your case if you want to see the bat that stores attribute owner
you will have to do:
1000000001_attr_own.print();
If you are using directly mil, I suggest you connect to the mserver
via mclient -lmil, it is easier.
lefteris
On Sat, Oct 25, 2008 at 11:48 PM, Chaojing Yang
Dear all,
I'm using MonetDB/XQuery. After i have added a few XML-files into MonetDB, i want to check out how their BATs looks like.
MonetDB>ls(); #---------------------------------------------------------------------------------------------------------------------------------# # name htype ttype count heat dirty status kind refcnt lrefcnt # # str str str lng int str str str int int # #---------------------------------------------------------------------------------------------------------------------------------# [ "1000000001_attr_own", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_prop", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_qn", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_frag_root", "oid", "oid", 1, 0, "clean", "disk", "pers", 0, 1 ] [ "1000000001_map_pid", "void", "oid", 1, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_nid_rid", "void", "oid", 25, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_com", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_ins", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ]
I get a list of BAT-data summary. But i cann't figure out how to use print functions from buildin module as listed:
231 .COMMAND print(ANY value) = CMDprint_val; 232 "Print a MIL value between square brackets." 233 234 .COMMAND print(BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) = CMDprint_table; 235 "BATs are printed with '#' for legend lines, and the BUNs on seperate 236 lines between brackets, containing each to comma separated values 237 (head and tail). 238 If multiple BATs are passed for printing, print() performs an implicit 239 natural join, producing a multiattribute table." 240 241 .COMMAND print(INT order, BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) 242 = CMDprint_otable; 243 "The same as normal table print, but enforces to use the order of 244 BAT number [1..argc] to do the printing." 245 246 .COMMAND table(BAT[any::1,any], ...BAT[any::1,any]...) = print_table_default; 247 "Print an n-ary table. Like print(n-ary) but does not print oid column" 248 249 .COMMAND table(INT order, BAT[any::1,any], ...BAT[any::1,any]...) = print_table; 250 "Print an n-ary table. Use the ordering of param [1..argc]" 251 252 .COMMAND multitable(BAT[any,bat]) = CMDprint_multitable; 253 "Print an n-ary table contained within a BAT of BATs" 254 255 .COMMAND printf(str format, ...) = print_format; 256 "Print a formatted string on the standard client output." 257 258 .COMMAND sprintf(str format, ...) : str = print_str; 259 "Print a formatted string on the standard client output." 260 261 262 .END builtin;
One single example may help me out of this trap.
Best regards, Chaojing
------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/
§1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz).
§2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen.
§3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
On Sun, Oct 26, 2008 at 09:23:00AM +0100, Lefteris wrote:
Hi,
all the print functions that you list in your email are the same function but overload with different types. What you have to simply do is: name_of_bat.print(); or print(name_of_bat);
In your case if you want to see the bat that stores attribute owner you will have to do:
1000000001_attr_own.print();
please note that above command do only work in case 'name_of_bat' and/or '1000000001_attr_own' are identifiers of MIL variables of type BAT refering to the respective BATs. In case you want to print a BAT given its name as string, you first need to convert the BAT name into a BAT vaiable using the 'bat()' function, e.g., print(bat("1000000001_attr_own")); Stefan
If you are using directly mil, I suggest you connect to the mserver via mclient -lmil, it is easier.
lefteris
On Sat, Oct 25, 2008 at 11:48 PM, Chaojing Yang
wrote: Dear all,
I'm using MonetDB/XQuery. After i have added a few XML-files into MonetDB, i want to check out how their BATs looks like.
MonetDB>ls(); #---------------------------------------------------------------------------------------------------------------------------------# # name htype ttype count heat dirty status kind refcnt lrefcnt # # str str str lng int str str str int int # #---------------------------------------------------------------------------------------------------------------------------------# [ "1000000001_attr_own", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_prop", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_attr_qn", "void", "oid", 5, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_frag_root", "oid", "oid", 1, 0, "clean", "disk", "pers", 0, 1 ] [ "1000000001_map_pid", "void", "oid", 1, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_nid_rid", "void", "oid", 25, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_com", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ] [ "1000000001_prop_ins", "void", "str", 0, 0, "clean", "disk", "pers", 0, 2 ]
I get a list of BAT-data summary. But i cann't figure out how to use print functions from buildin module as listed:
231 .COMMAND print(ANY value) = CMDprint_val; 232 "Print a MIL value between square brackets." 233 234 .COMMAND print(BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) = CMDprint_table; 235 "BATs are printed with '#' for legend lines, and the BUNs on seperate 236 lines between brackets, containing each to comma separated values 237 (head and tail). 238 If multiple BATs are passed for printing, print() performs an implicit 239 natural join, producing a multiattribute table." 240 241 .COMMAND print(INT order, BAT[ANY::1,ANY], ...BAT[ANY::1,ANY]...) 242 = CMDprint_otable; 243 "The same as normal table print, but enforces to use the order of 244 BAT number [1..argc] to do the printing." 245 246 .COMMAND table(BAT[any::1,any], ...BAT[any::1,any]...) = print_table_default; 247 "Print an n-ary table. Like print(n-ary) but does not print oid column" 248 249 .COMMAND table(INT order, BAT[any::1,any], ...BAT[any::1,any]...) = print_table; 250 "Print an n-ary table. Use the ordering of param [1..argc]" 251 252 .COMMAND multitable(BAT[any,bat]) = CMDprint_multitable; 253 "Print an n-ary table contained within a BAT of BATs" 254 255 .COMMAND printf(str format, ...) = print_format; 256 "Print a formatted string on the standard client output." 257 258 .COMMAND sprintf(str format, ...) : str = print_str; 259 "Print a formatted string on the standard client output." 260 261 262 .END builtin;
One single example may help me out of this trap.
Best regards, Chaojing
------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/
§1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz).
§2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen.
§3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | 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 |
Hi, thx for all your kind answers. I also find this feature is actually well documented in: http://monetdb.cwi.nl/MonetDB/Version4/Documentation/monet/index.html As deprecated at website, i have never paid attention to these staffs. For those who use MonetDB/XQuery, that may really helpful, at least to be noticed the existence of these documentations. Old problems solved and new questions appear. The mention XML-files flat.xml and deep.xml are send with this mail. Both file have the some content but different structure. flat.xml with less levels and deep.xml with more levels. * Q1: XPath/XQuery will be translated in MIL-Expressions, is the translation deterministic? I mean, can this happen that the same input of XPath/XQuery o will be translated into different MIL-Expressions at different times? o This question seems more related with operation( // , self-or-descendant). * Q2: How should i consider execution cost of XPath? o I.E 1: doc(\"flat.xml\")//entry[@rdn='uid=user.301'] + like one single stair-case-join? + Test result: Need *less *time for execution o I.E 2: doc(\"flat.xml\")/dsml/directory-entries/entry[@rdn='uid=user.301'] + like some nested normal selections? + Test result: Need *more *time for execution * Q3: Is that possible to get translated MIL-Expressions of XPath/XQuery? * Q4: About design of XML. Is there any trade-off-rules, that should be considers with structure design of XML. o For small XML less levels will achieve better performance? o For big XML more levels will achieve better performance? o Test result with flat.xml and deep.xml: ( The difference i found, any explanations? ) + from deep.xml: [ "1000000016_vx_hsh_nid", "int", "oid", 1726, 0, "clean", "load", "pers", 0, 1 ] + from flat.xml: [ "1000000017_vx_hsh_nid", "int", "oid", 825, 0, "clean", "load", "pers", 0, 1 ] So far get so much confused points, hope some experts can give me a hint. Best regards, Chaojing -- ------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/ §1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz). §2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen. §3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
participants (3)
-
Chaojing Yang
-
Lefteris
-
Stefan Manegold