Changes between Version 13 and Version 14 of DatabaseBasedAnalysis/rootifysql
- Timestamp:
- 08/05/18 20:10:07 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DatabaseBasedAnalysis/rootifysql
v13 v14 19 19 20 20 21 Generally, compression should be enable if connecting from the world. To test compression, the "''Hello World! ''" example can be used.21 Generally, compression should be enable if connecting from the world. To test compression, the "''Hello World! ''" example can be used. 22 22 23 23 In the following it is assumed that the database connection is working and tested, so that the resources ({{{uri=...}}}) are omitted. … … 25 25 == Hello World! == 26 26 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.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. 28 28 29 29 {{{ … … 57 57 Voila! 58 58 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. 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. {{{-q}}} is a shortcut for {{{--query}}} 60 60 61 61 == Query in the file == … … 144 144 Let's try our previous example 145 145 {{{ 146 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 - -query="SELECT 'Hello World\!'"146 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!'" 147 147 [...] 148 148 ------------------------ Rootify SQL ------------------------- … … 167 167 168 168 {{{ 169 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 - -query="SELECT 'Hello World\!', 1"169 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1" 170 170 [...] 171 171 ------------------------ Rootify SQL ------------------------- … … 194 194 To have another way to skip columns, all variables defined in a query are skipped: 195 195 {{{ 196 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 - -query="SELECT 'Hello World\!', 1, @a:=5"196 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5" 197 197 [...] 198 198 ------------------------ Rootify SQL ------------------------- … … 215 215 216 216 {{{ 217 fact@ihp-pc45:~/FACT++/build> rootifysql -f - -query="SELECT 1" --out newfile.root --tree MyTree217 fact@ihp-pc45:~/FACT++/build> rootifysql -f -q "SELECT 1" --out newfile.root --tree MyTree 218 218 [...] 219 219 Opening file 'newfile.root' [compression=1]... … … 225 225 226 226 {{{ 227 fact@ihp-pc45:~/FACT++/build> rootifysql --update - -query="SELECT 1" --out newfile.root --tree MyNewTree227 fact@ihp-pc45:~/FACT++/build> rootifysql --update -q "SELECT 1" --out newfile.root --tree MyNewTree 228 228 [...] 229 229 Opening file 'newfile.root' [compression=1]... … … 249 249 This can be circumvented by giving it a name 250 250 {{{ 251 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 - -query="SELECT 'Hello World\!', 1, @a:=5 AS MyName"251 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5 AS MyName" 252 252 [...] 253 253 ------------------------ Rootify SQL ------------------------- … … 270 270 Now 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: 271 271 {{{ 272 fact@ihp-pc45:~/FACT++/build> rootifysql -f -v 2 --query="SELECT 'Hello World\!', 1, @a:=5 AS MyName" --ignore MyName272 user@machine> rootifysql -f -v 2 -q "SELECT 'Hello World\!', 1, @a:=5 AS MyName" --ignore MyName 273 273 [...] 274 274 ------------------------ Rootify SQL ------------------------- … … 294 294 295 295 {{{ 296 user@machine> rootifysql -n -d - -query="SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2" --ignore Col0296 user@machine> rootifysql -n -d -q "SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2" --ignore Col0 297 297 [...] 298 298 ------------------------ Rootify SQL ------------------------- … … 318 318 319 319 {{{ 320 user@machine> rootifysql -n -d -i - -query="SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2"320 user@machine> rootifysql -n -d -i -q "SELECT NULL AS Col0, 1 AS Col1, 2 AS Col2" 321 321 [...] 322 322 ------------------------ Rootify SQL ------------------------- … … 347 347 348 348 {{{ 349 user@machine> rootifysql -n -d -v 3 - -query="SELECT @myvar" --var.myvar=42349 user@machine> rootifysql -n -d -v 3 -q "SELECT @myvar" --var.myvar=42 350 350 [...] 351 351 ------------------------ Rootify SQL ------------------------- … … 389 389 390 390 {{{ 391 user@machine> rootifysql -n -d -v 3 - -query="SELECT \$myvar1, \${myvar2}, '\$myvar3'" --env.myvar1=1 --env.myvar2=2 --env.myvar3=3 --env.myvar3=4391 user@machine> rootifysql -n -d -v 3 -q "SELECT \$myvar1, \${myvar2}, '\$myvar3'" --env.myvar1=1 --env.myvar2=2 --env.myvar3=3 --env.myvar3=4 392 392 [...] 393 393 ------------------------ Rootify SQL ------------------------- … … 433 433 434 434 {{{ 435 user@machine> rootifysql -n -d -v 3 - -query="SELECT \$myvar" --list.myvar=input.txt435 user@machine> rootifysql -n -d -v 3 -q "SELECT \$myvar" --list.myvar=input.txt 436 436 [...] 437 437 ------------------------ Rootify SQL -------------------------