| ~~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~~ contributor license agreements. See the NOTICE file distributed with |
| ~~ this work for additional information regarding copyright ownership. |
| ~~ The ASF licenses this file to You under the Apache License, Version 2.0 |
| ~~ (the "License"); you may not use this file except in compliance with |
| ~~ the License. You may obtain a copy of the License at |
| ~~ |
| ~~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~~ |
| ~~ Unless required by applicable law or agreed to in writing, software |
| ~~ distributed under the License is distributed on an "AS IS" BASIS, |
| ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ~~ See the License for the specific language governing permissions and |
| ~~ limitations under the License. |
| |
| Executing a Query |
| |
| |
| * Command On *nix Based Systems |
| |
| ---------------------------------------- |
| sh ./apache-vxquery-X.Y/vxquery-cli/target/appassembler/bin/vxq |
| ---------------------------------------- |
| |
| * Commands On Windows Based Systems |
| |
| ---------------------------------------- |
| set JAVA_OPTS=-Xmx1024m |
| set PATH=%PATH%;"path-to"\apache-vxquery-X.Y\vxquery-cli\target\appassembler\bin\ |
| vxq "path-to"\test.xq |
| ---------------------------------------- |
| |
| * Command Line Options |
| |
| Command line options for all systems. |
| |
| ---------------------------------------- |
| -O N : Optimization Level. (default: Full Optimization) |
| -available-processors N : Number of available processors. (default: java's available processors) |
| -buffer-size N : Disk read buffer size in bytes. |
| -compileonly : Compile the query and stop. |
| -frame-size N : Frame size in bytes. (default: 65,536) |
| -hdfs-conf VAL : Directory path to Hadoop configuration files |
| -join-hash-size N : Join hash size in bytes. (default: 67,108,864) |
| -local-node-controllers N : Number of local node controllers. (default: 1) |
| -maximum-data-size N : Maximum possible data size in bytes. (default: 150,323,855,000) |
| -repeatexec N : Number of times to repeat execution. |
| -rest-ip-address VAL : IP Address of the REST Server. |
| -rest-port N : Port of REST Server. |
| -result-file VAL : File path to save the query result. |
| -showast : Show abstract syntax tree. |
| -showoet : Show optimized expression tree. |
| -showquery : Show query string. |
| -showrp : Show Runtime plan. |
| -showtet : Show translated expression tree. |
| -timing : Produce timing information. |
| -timing-ignore-queries N : Ignore the first X number of quereies. |
| ---------------------------------------- |
| |
| * Java Options |
| |
| ---------------------------------------- |
| JAVA_OPTS="-Xmx1024m" |
| ---------------------------------------- |
| |
| |
| * Example |
| |
| The following example query is from {{{http://www.w3schools.com/xquery/default.asp}W3Schools XQuery Tutorial}}. |
| If you are new to XQuery, the W3Schools tutorial is a great place to start. |
| |
| [[i]] Query file (test.xq) |
| |
| ---------------------------------------- |
| for $x in doc("books.xml")/bookstore/book |
| where $x/price>30 |
| order by $x/title |
| return $x/title |
| ---------------------------------------- |
| |
| [[i]] Command line |
| |
| ---------------------------------------- |
| JAVA_OPTS="-Xmx1024m" sh ./apache-vxquery-X.Y/vxquery-cli/target/appassembler/bin/vxq test.xq |
| ---------------------------------------- |