Changes between Version 13 and Version 14 of DatabaseBasedAnalysis/rootifysql


Ignore:
Timestamp:
08/05/18 20:10:07 (6 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseBasedAnalysis/rootifysql

    v13 v14  
    1919
    2020
    21 Generally, compression should be enable if connecting from the world. To test compression, the "''Hello World!''" example can be used.
     21Generally, compression should be enable if connecting from the world. To test compression, the "''Hello World! ''" example can be used.
    2222
    2323In the following it is assumed that the database connection is working and tested, so that the resources ({{{uri=...}}}) are omitted.
     
    2525== Hello World! ==
    2626
    27 To test if everything is working correctly, we run a "''Hello World!''" example. Credentials should be in the rootifysql.rc which should be write protected.
     27To test if everything is working correctly, we run a "''Hello World! ''" example. Credentials should be in the rootifysql.rc which should be write protected.
    2828
    2929{{{
     
    5757Voila!
    5858
    59 The {{{-d}}} option (a shortcut for {{{--display}}}) prints the result on standard out, the {{{-n}}} option (a shortcut to {{{--null}}}) redirects all output to {{{/dev/null}}} instead to a file. For benchmarking your query, you can also add {{{--no-fill}}} which does not only write to a root tree at {{{/dev/null}}} but does not fill the root tree at all.
     59The {{{-d}}} option (a shortcut for {{{--display}}}) prints the result on standard out, the {{{-n}}} option (a shortcut to {{{--null}}}) redirects all output to {{{/dev/null}}} instead to a file. For benchmarking your query, you can also add {{{--no-fill}}} which does not only write to a root tree at {{{/dev/null}}} but does not fill the root tree at all. {{{-q}}} is a shortcut for {{{--query}}}
    6060
    6161== Query in the file ==
     
    144144Let's try our previous example
    145145{{{
    146 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!'"
     146fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!'"
    147147[...]
    148148------------------------ Rootify SQL -------------------------
     
    167167
    168168{{{
    169 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!', 1"
     169fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1"
    170170[...]
    171171------------------------ Rootify SQL -------------------------
     
    194194To have another way to skip columns, all variables defined in a query are skipped:
    195195{{{
    196 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!', 1, @a:=5"
     196fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5"
    197197[...]
    198198------------------------ Rootify SQL -------------------------
     
    215215
    216216{{{
    217 fact@ihp-pc45:~/FACT++/build> rootifysql -f --query="SELECT 1" --out newfile.root --tree MyTree
     217fact@ihp-pc45:~/FACT++/build> rootifysql -f -q "SELECT 1" --out newfile.root --tree MyTree
    218218[...]
    219219Opening file 'newfile.root' [compression=1]...
     
    225225
    226226{{{
    227 fact@ihp-pc45:~/FACT++/build> rootifysql --update --query="SELECT 1" --out newfile.root --tree MyNewTree
     227fact@ihp-pc45:~/FACT++/build> rootifysql --update -q "SELECT 1" --out newfile.root --tree MyNewTree
    228228[...]
    229229Opening file 'newfile.root' [compression=1]...
     
    249249This can be circumvented by giving it a name
    250250{{{
    251 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!', 1, @a:=5 AS MyName"
     251fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5 AS MyName"
    252252[...]
    253253------------------------ Rootify SQL -------------------------
     
    270270Now assuming you want to create a very general query but then skip some column in the root-file (usually, it is more efficient to just don't query them, because they are transferred from the server nevertheless). In this case you can do:
    271271{{{
    272 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!', 1, @a:=5 AS MyName" --ignore MyName
     272user@machine> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5 AS MyName" --ignore MyName
    273273[...]
    274274------------------------ Rootify SQL -------------------------
     
    294294
    295295{{{
    296 user@machine> rootifysql -n -d --query="SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2" --ignore Col0
     296user@machine> rootifysql -n -d -q "SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2" --ignore Col0
    297297[...]
    298298------------------------ Rootify SQL -------------------------
     
    318318
    319319{{{
    320 user@machine> rootifysql -n -d -i --query="SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2"
     320user@machine> rootifysql -n -d -i -q "SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2"
    321321[...]
    322322------------------------ Rootify SQL -------------------------
     
    347347
    348348{{{
    349 user@machine> rootifysql -n -d -v 3 --query="SELECT @myvar" --var.myvar=42
     349user@machine> rootifysql -n -d -v 3 -q "SELECT @myvar" --var.myvar=42
    350350[...]
    351351------------------------ Rootify SQL -------------------------
     
    389389
    390390{{{
    391 user@machine> rootifysql -n -d -v 3 --query="SELECT \$myvar1, \${myvar2}, '\$myvar3'" --env.myvar1=1 --env.myvar2=2 --env.myvar3=3 --env.myvar3=4
     391user@machine> rootifysql -n -d -v 3 -q "SELECT \$myvar1, \${myvar2}, '\$myvar3'" --env.myvar1=1 --env.myvar2=2 --env.myvar3=3 --env.myvar3=4
    392392[...]
    393393------------------------ Rootify SQL -------------------------
     
    433433
    434434{{{
    435 user@machine> rootifysql -n -d -v 3 --query="SELECT \$myvar" --list.myvar=input.txt
     435user@machine> rootifysql -n -d -v 3 -q "SELECT \$myvar" --list.myvar=input.txt
    436436[...]
    437437------------------------ Rootify SQL -------------------------