POST Hadoop SQL operation of QueryIO server will execute given Hadoop SQL query.
POST/os3server/hadoopsql/
HTTP/1.1 Host: QueryIO.com authorization:<Token>
The POST Hadoop SQL operation in QueryIO Server uses following request headers:
Header Name | Description | Type | Default | Required |
---|---|---|---|---|
sqlquery
|
Standard SQL Query on BigData |
String | None | Yes (Not to be used with "queryid" header) |
queryid
|
Id of the Hadoop SQL query to be executed. Specify the report format in the hadoopsql-report-format header in which result will be generated. |
String | None | Yes (Not to be used with "sqlquery" header) |
hadoopsql-report-format
|
Report format: PDF/HTML/XLS |
String | None | Yes (To be used only with "queryid" header) |
startindex
|
Start index |
String | None | No |
maxresults
|
Max results |
String | None | No |
timeout
|
Query timeout in ms |
String | None | No |
The following request will execute a Hadoop SQL query and returns a JSON response.
POST /queryio/hadoopsql/ HTTP/1.1 Host: QueryIO authorization: iffo6l9hel2hfmbj2384joljgh9mqga58gb9if9593ucli9ke5s2e3854shhcmmm sqlquery : "SELECT * FROM HDFS_METADATA" startindex : 5 maxresults : 7 timeout : 300
<xml version="1.0" encoding="UTF-8"> <ExecuteHadoopSQLResult> <HadoopSQLResult><![CDATA[ { "schema": { "fields": [ "Filepath", "Accesstime", "Modificationtime", "Owner", "Usergroup", "Permission", "Blocksize", "Replication", "Len" ] }, "totalRows": 7, "jobComplete": true, "rows": [ [ "/__MACOSX/hadoop-1.0.1/bin/._hadoop-daemon.sh", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "193" ], [ "/hadoop-1.0.1/bin/hadoop-daemons.sh", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "1329" ], [ "/__MACOSX/hadoop-1.0.1/bin/._hadoop-daemons.sh", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "193" ], [ "/hadoop-1.0.1/bin/rcc", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "2810" ], [ "/__MACOSX/hadoop-1.0.1/bin/._rcc", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "193" ], [ "/hadoop-1.0.1/bin/slaves.sh", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "2143" ], [ "/__MACOSX/hadoop-1.0.1/bin/._slaves.sh", "2012-11-07 14:57 PM", "2012-11-07 14:57 PM", "admin", "hiper", "rw-r--r--", "67108864", "1", "193" ] ] }]]> </HadoopSQLResult> </ExecuteHadoopSQLResult>