presto-client
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -54,3 +54,3 @@ var http = require('http'); | ||
var data = response_data; | ||
if (response_code < 300 && (response_data[0] === '{' || response_data === '[')) { | ||
if (response_code < 300 && (data[0] === '{' || data[0] === '[')) { | ||
try { data = JSON.parse(data); } | ||
@@ -230,3 +230,9 @@ catch (x) { | ||
if (cancel_checker && cancel_checker()) { | ||
error_callback({message: "query fetch canceled by operation"}); | ||
client.request({ method: 'DELETE', path: next_uri }, function(error, code, data){ | ||
if (error || code !== 204) { | ||
error_callback({message: "query fetch canceled, but Presto query cancel may fail", error: error, code: code}); | ||
} else { | ||
error_callback({message: "query fetch canceled by operation"}); | ||
} | ||
}); | ||
return; | ||
@@ -233,0 +239,0 @@ } |
{ | ||
"name": "presto-client", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Distributed query engine Presto client library for node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -92,31 +92,31 @@ # presto-client-node | ||
* opts [object] | ||
* query [string] | ||
* catalog [string] | ||
* schema [string] | ||
* info [boolean :optional] | ||
* fetch query info (execution statistics) for success callback, or not (default false) | ||
* cancel [function() :optional] | ||
* client stops fetch of query results if this callback returns `true` | ||
* columns [function(error, data) :optional] | ||
* called once when columns and its types are found in results | ||
* data | ||
* array of field info | ||
* `[ { name: "username", type: "varchar" }, { name: "cnt", type: "bigint" } ]` | ||
* data [function(error, data, columns, stats) :optional] | ||
* called per fetch of query results (may be called 2 or more) | ||
* data | ||
* array of array of each column | ||
* `[ [ "tagomoris", 1013 ], [ "dain", 2056 ], ... ]` | ||
* columns (optional) | ||
* same as data of `columns` callback | ||
* stats (optional) | ||
* runtime statistics object of query | ||
* success [function(error, stats, info) :optional] | ||
* called once when all results are fetched (default: value of `callback`) | ||
* error [function(error) :optional] | ||
* callback for errors of query execution (default: value of `callback`) | ||
* callback [function(error, stats) :optional] | ||
* callback for query completion (both of success and fail) | ||
* one of this option or `success` must be specified | ||
Attributes of opts [object] are: | ||
* query [string] | ||
* catalog [string] | ||
* schema [string] | ||
* info [boolean :optional] | ||
* fetch query info (execution statistics) for success callback, or not (default false) | ||
* cancel [function() :optional] | ||
* client stops fetch of query results if this callback returns `true` | ||
* columns [function(error, data) :optional] | ||
* called once when columns and its types are found in results | ||
* data | ||
* array of field info | ||
* `[ { name: "username", type: "varchar" }, { name: "cnt", type: "bigint" } ]` | ||
* data [function(error, data, columns, stats) :optional] | ||
* called per fetch of query results (may be called 2 or more) | ||
* data | ||
* array of array of each column | ||
* `[ [ "tagomoris", 1013 ], [ "dain", 2056 ], ... ]` | ||
* columns (optional) | ||
* same as data of `columns` callback | ||
* stats (optional) | ||
* runtime statistics object of query | ||
* success [function(error, stats, info) :optional] | ||
* called once when all results are fetched (default: value of `callback`) | ||
* error [function(error) :optional] | ||
* callback for errors of query execution (default: value of `callback`) | ||
* callback [function(error, stats) :optional] | ||
* callback for query completion (both of success and fail) | ||
* one of `callback` or `success` must be specified | ||
@@ -138,2 +138,4 @@ Callbacks order (success query) is: columns -> data (-> data xN) -> success (or callback) | ||
* 0.0.4: | ||
* send cancel request of canceled query actually | ||
* 0.0.3: | ||
@@ -140,0 +142,0 @@ * simple and immediate query execution support |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17385
7
313
155