@databricks/sql 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DBSQLClient.d.ts +8 -6
- package/dist/DBSQLClient.js +98 -59
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLOperation/OperationStatusHelper.d.ts +1 -1
- package/dist/DBSQLOperation/OperationStatusHelper.js +29 -6
- package/dist/DBSQLOperation/OperationStatusHelper.js.map +1 -1
- package/dist/DBSQLOperation/SchemaHelper.d.ts +1 -0
- package/dist/DBSQLOperation/SchemaHelper.js +20 -7
- package/dist/DBSQLOperation/SchemaHelper.js.map +1 -1
- package/dist/DBSQLOperation/index.d.ts +9 -2
- package/dist/DBSQLOperation/index.js +86 -10
- package/dist/DBSQLOperation/index.js.map +1 -1
- package/dist/DBSQLSession.d.ts +10 -1
- package/dist/DBSQLSession.js +72 -14
- package/dist/DBSQLSession.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.d.ts +24 -0
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js +165 -0
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js.map +1 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.d.ts +47 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js +169 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js.map +1 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthPersistence.d.ts +10 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthPersistence.js +29 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthPersistence.js.map +1 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthScope.d.ts +7 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthScope.js +11 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthScope.js.map +1 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthToken.d.ts +10 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthToken.js +32 -0
- package/dist/connection/auth/DatabricksOAuth/OAuthToken.js.map +1 -0
- package/dist/connection/auth/DatabricksOAuth/index.d.ts +21 -0
- package/dist/connection/auth/DatabricksOAuth/index.js +41 -0
- package/dist/connection/auth/DatabricksOAuth/index.js.map +1 -0
- package/dist/connection/auth/PlainHttpAuthentication.d.ts +11 -11
- package/dist/connection/auth/PlainHttpAuthentication.js +15 -7
- package/dist/connection/auth/PlainHttpAuthentication.js.map +1 -1
- package/dist/connection/connections/HttpConnection.d.ts +1 -2
- package/dist/connection/connections/HttpConnection.js +24 -14
- package/dist/connection/connections/HttpConnection.js.map +1 -1
- package/dist/connection/contracts/IAuthentication.d.ts +2 -2
- package/dist/connection/contracts/IConnectionOptions.d.ts +3 -1
- package/dist/connection/contracts/IConnectionProvider.d.ts +1 -2
- package/dist/contracts/IDBSQLClient.d.ts +17 -3
- package/dist/contracts/IDBSQLSession.d.ts +1 -0
- package/dist/errors/OperationStateError.d.ts +10 -2
- package/dist/errors/OperationStateError.js +19 -2
- package/dist/errors/OperationStateError.js.map +1 -1
- package/dist/globalConfig.d.ts +7 -0
- package/dist/globalConfig.js +7 -0
- package/dist/globalConfig.js.map +1 -1
- package/dist/hive/Commands/BaseCommand.d.ts +3 -1
- package/dist/hive/Commands/BaseCommand.js +66 -4
- package/dist/hive/Commands/BaseCommand.js.map +1 -1
- package/dist/hive/HiveDriver.d.ts +3 -2
- package/dist/hive/HiveDriver.js +116 -44
- package/dist/hive/HiveDriver.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js +8 -0
- package/dist/result/ArrowResult.d.ts +3 -2
- package/dist/result/ArrowResult.js +38 -17
- package/dist/result/ArrowResult.js.map +1 -1
- package/dist/result/CloudFetchResult.d.ts +13 -0
- package/dist/result/CloudFetchResult.js +69 -0
- package/dist/result/CloudFetchResult.js.map +1 -0
- package/dist/result/IOperationResult.d.ts +2 -1
- package/dist/result/JsonResult.d.ts +2 -1
- package/dist/result/JsonResult.js +24 -8
- package/dist/result/JsonResult.js.map +1 -1
- package/dist/utils/CloseableCollection.d.ts +10 -0
- package/dist/utils/CloseableCollection.js +40 -0
- package/dist/utils/CloseableCollection.js.map +1 -0
- package/dist/utils/areHeadersEqual.d.ts +2 -0
- package/dist/utils/areHeadersEqual.js +49 -0
- package/dist/utils/areHeadersEqual.js.map +1 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -2
- package/thrift/TCLIService.d.ts +60 -0
- package/thrift/TCLIService_types.d.ts +206 -14
- package/thrift/TCLIService_types.js +2334 -291
- package/dist/connection/auth/NoSaslAuthentication.d.ts +0 -5
- package/dist/connection/auth/NoSaslAuthentication.js +0 -14
- package/dist/connection/auth/NoSaslAuthentication.js.map +0 -1
- package/dist/connection/auth/helpers/SaslPackageFactory.d.ts +0 -11
- package/dist/connection/auth/helpers/SaslPackageFactory.js +0 -20
- package/dist/connection/auth/helpers/SaslPackageFactory.js.map +0 -1
- package/dist/connection/contracts/ITransport.d.ts +0 -6
- package/dist/connection/contracts/ITransport.js +0 -3
- package/dist/connection/contracts/ITransport.js.map +0 -1
- package/dist/connection/transports/HttpTransport.d.ts +0 -8
- package/dist/connection/transports/HttpTransport.js +0 -18
- package/dist/connection/transports/HttpTransport.js.map +0 -1
- package/dist/connection/types/AuthOptions.d.ts +0 -4
- package/dist/connection/types/AuthOptions.js +0 -3
- package/dist/connection/types/AuthOptions.js.map +0 -1
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import IDBSQLLogger from './IDBSQLLogger';
|
|
2
2
|
import IDBSQLSession from './IDBSQLSession';
|
|
3
|
+
import IAuthentication from '../connection/contracts/IAuthentication';
|
|
4
|
+
import OAuthPersistence from '../connection/auth/DatabricksOAuth/OAuthPersistence';
|
|
3
5
|
export interface ClientOptions {
|
|
4
6
|
logger?: IDBSQLLogger;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
type AuthOptions = {
|
|
9
|
+
authType?: 'access-token';
|
|
10
|
+
token: string;
|
|
11
|
+
} | {
|
|
12
|
+
authType: 'databricks-oauth';
|
|
13
|
+
persistence?: OAuthPersistence;
|
|
14
|
+
azureTenantId?: string;
|
|
15
|
+
} | {
|
|
16
|
+
authType: 'custom';
|
|
17
|
+
provider: IAuthentication;
|
|
18
|
+
};
|
|
19
|
+
export type ConnectionOptions = {
|
|
7
20
|
host: string;
|
|
8
21
|
port?: number;
|
|
9
22
|
path: string;
|
|
10
|
-
token: string;
|
|
11
23
|
clientId?: string;
|
|
12
|
-
|
|
24
|
+
socketTimeout?: number;
|
|
25
|
+
} & AuthOptions;
|
|
13
26
|
export interface OpenSessionRequest {
|
|
14
27
|
initialCatalog?: string;
|
|
15
28
|
initialSchema?: string;
|
|
@@ -19,3 +32,4 @@ export default interface IDBSQLClient {
|
|
|
19
32
|
openSession(request?: OpenSessionRequest): Promise<IDBSQLSession>;
|
|
20
33
|
close(): Promise<void>;
|
|
21
34
|
}
|
|
35
|
+
export {};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import HiveDriverError from './HiveDriverError';
|
|
2
2
|
import { TGetOperationStatusResp } from '../../thrift/TCLIService_types';
|
|
3
|
+
export declare enum OperationStateErrorCode {
|
|
4
|
+
Canceled = "CANCELED",
|
|
5
|
+
Closed = "CLOSED",
|
|
6
|
+
Error = "ERROR",
|
|
7
|
+
Timeout = "TIMEOUT",
|
|
8
|
+
Unknown = "UNKNOWN"
|
|
9
|
+
}
|
|
3
10
|
export default class OperationStateError extends HiveDriverError {
|
|
4
|
-
|
|
5
|
-
|
|
11
|
+
errorCode: OperationStateErrorCode;
|
|
12
|
+
response?: TGetOperationStatusResp;
|
|
13
|
+
constructor(errorCode: OperationStateErrorCode, response?: TGetOperationStatusResp);
|
|
6
14
|
}
|
|
@@ -3,10 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OperationStateErrorCode = void 0;
|
|
6
7
|
const HiveDriverError_1 = __importDefault(require("./HiveDriverError"));
|
|
8
|
+
var OperationStateErrorCode;
|
|
9
|
+
(function (OperationStateErrorCode) {
|
|
10
|
+
OperationStateErrorCode["Canceled"] = "CANCELED";
|
|
11
|
+
OperationStateErrorCode["Closed"] = "CLOSED";
|
|
12
|
+
OperationStateErrorCode["Error"] = "ERROR";
|
|
13
|
+
OperationStateErrorCode["Timeout"] = "TIMEOUT";
|
|
14
|
+
OperationStateErrorCode["Unknown"] = "UNKNOWN";
|
|
15
|
+
})(OperationStateErrorCode = exports.OperationStateErrorCode || (exports.OperationStateErrorCode = {}));
|
|
16
|
+
const errorMessages = {
|
|
17
|
+
[OperationStateErrorCode.Canceled]: 'The operation was canceled by a client',
|
|
18
|
+
[OperationStateErrorCode.Closed]: 'The operation was closed by a client',
|
|
19
|
+
[OperationStateErrorCode.Error]: 'The operation failed due to an error',
|
|
20
|
+
[OperationStateErrorCode.Timeout]: 'The operation is in a timed out state',
|
|
21
|
+
[OperationStateErrorCode.Unknown]: 'The operation is in an unrecognized state',
|
|
22
|
+
};
|
|
7
23
|
class OperationStateError extends HiveDriverError_1.default {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
24
|
+
constructor(errorCode, response) {
|
|
25
|
+
super(errorMessages[errorCode]);
|
|
26
|
+
this.errorCode = errorCode;
|
|
10
27
|
this.response = response;
|
|
11
28
|
}
|
|
12
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationStateError.js","sourceRoot":"","sources":["../../lib/errors/OperationStateError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationStateError.js","sourceRoot":"","sources":["../../lib/errors/OperationStateError.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAgD;AAGhD,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,gDAAqB,CAAA;IACrB,4CAAiB,CAAA;IACjB,0CAAe,CAAA;IACf,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;AACrB,CAAC,EANW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAMlC;AAED,MAAM,aAAa,GAA4C;IAC7D,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,wCAAwC;IAC5E,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,sCAAsC;IACxE,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE,sCAAsC;IACvE,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,uCAAuC;IAC1E,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,2CAA2C;CAC/E,CAAC;AAEF,MAAqB,mBAAoB,SAAQ,yBAAe;IAK9D,YAAY,SAAkC,EAAE,QAAkC;QAChF,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAXD,sCAWC"}
|
package/dist/globalConfig.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
arrowEnabled: true;
|
|
3
3
|
useArrowNativeTypes: true;
|
|
4
|
+
socketTimeout: number;
|
|
5
|
+
retryMaxAttempts: number;
|
|
6
|
+
retriesTimeout: number;
|
|
7
|
+
retryDelayMin: number;
|
|
8
|
+
retryDelayMax: number;
|
|
9
|
+
useCloudFetch: false;
|
|
10
|
+
cloudFetchConcurrentDownloads: number;
|
|
4
11
|
};
|
|
5
12
|
export default _default;
|
package/dist/globalConfig.js
CHANGED
|
@@ -3,5 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = {
|
|
4
4
|
arrowEnabled: true,
|
|
5
5
|
useArrowNativeTypes: true,
|
|
6
|
+
socketTimeout: 15 * 60 * 1000,
|
|
7
|
+
retryMaxAttempts: 30,
|
|
8
|
+
retriesTimeout: 900 * 1000,
|
|
9
|
+
retryDelayMin: 1 * 1000,
|
|
10
|
+
retryDelayMax: 60 * 1000,
|
|
11
|
+
useCloudFetch: false,
|
|
12
|
+
cloudFetchConcurrentDownloads: 10,
|
|
6
13
|
};
|
|
7
14
|
//# sourceMappingURL=globalConfig.js.map
|
package/dist/globalConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalConfig.js","sourceRoot":"","sources":["../lib/globalConfig.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"globalConfig.js","sourceRoot":"","sources":["../lib/globalConfig.ts"],"names":[],"mappings":";;AAcA,kBAAe;IACb,YAAY,EAAE,IAAI;IAClB,mBAAmB,EAAE,IAAI;IACzB,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IAE7B,gBAAgB,EAAE,EAAE;IACpB,cAAc,EAAE,GAAG,GAAG,IAAI;IAC1B,aAAa,EAAE,CAAC,GAAG,IAAI;IACvB,aAAa,EAAE,EAAE,GAAG,IAAI;IAExB,aAAa,EAAE,KAAK;IACpB,6BAA6B,EAAE,EAAE;CACX,CAAC"}
|
|
@@ -2,5 +2,7 @@ import TCLIService from '../../../thrift/TCLIService';
|
|
|
2
2
|
export default abstract class BaseCommand {
|
|
3
3
|
protected client: TCLIService.Client;
|
|
4
4
|
constructor(client: TCLIService.Client);
|
|
5
|
-
executeCommand<Response>(request: object, command: Function | void): Promise<Response>;
|
|
5
|
+
protected executeCommand<Response>(request: object, command: Function | void): Promise<Response>;
|
|
6
|
+
private invokeWithErrorHandling;
|
|
7
|
+
private invokeCommand;
|
|
6
8
|
}
|
|
@@ -1,19 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const thrift_1 = require("thrift");
|
|
6
16
|
const HiveDriverError_1 = __importDefault(require("../../errors/HiveDriverError"));
|
|
17
|
+
const globalConfig_1 = __importDefault(require("../../globalConfig"));
|
|
18
|
+
function getRetryDelay(attempt) {
|
|
19
|
+
const scale = Math.max(1, Math.pow(1.5, (attempt - 1))); // ensure scale >= 1
|
|
20
|
+
return Math.min(globalConfig_1.default.retryDelayMin * scale, globalConfig_1.default.retryDelayMax);
|
|
21
|
+
}
|
|
22
|
+
function delay(milliseconds) {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
setTimeout(() => resolve(), milliseconds);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
7
27
|
class BaseCommand {
|
|
8
28
|
constructor(client) {
|
|
9
29
|
this.client = client;
|
|
10
30
|
}
|
|
11
31
|
executeCommand(request, command) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
return this.invokeWithErrorHandling(request, command, { startTime: Date.now(), attempt: 0 });
|
|
33
|
+
}
|
|
34
|
+
invokeWithErrorHandling(request, command, info) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
return yield this.invokeCommand(request, command);
|
|
16
38
|
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error instanceof thrift_1.Thrift.TApplicationException) {
|
|
41
|
+
if ('statusCode' in error) {
|
|
42
|
+
switch (error.statusCode) {
|
|
43
|
+
// On these status codes it's safe to retry the request. However,
|
|
44
|
+
// both error codes mean that server is overwhelmed or even down.
|
|
45
|
+
// Therefore, we need to add some delay between attempts so
|
|
46
|
+
// server can recover and more likely handle next request
|
|
47
|
+
case 429: // Too Many Requests
|
|
48
|
+
case 503: // Service Unavailable
|
|
49
|
+
info.attempt += 1;
|
|
50
|
+
// Delay interval depends on current attempt - the more attempts we do
|
|
51
|
+
// the longer the interval will be
|
|
52
|
+
// TODO: Respect `Retry-After` header (PECO-729)
|
|
53
|
+
const retryDelay = getRetryDelay(info.attempt);
|
|
54
|
+
const attemptsExceeded = info.attempt >= globalConfig_1.default.retryMaxAttempts;
|
|
55
|
+
if (attemptsExceeded) {
|
|
56
|
+
throw new HiveDriverError_1.default(`Hive driver: ${error.statusCode} when connecting to resource. Max retry count exceeded.`);
|
|
57
|
+
}
|
|
58
|
+
const timeoutExceeded = Date.now() - info.startTime + retryDelay >= globalConfig_1.default.retriesTimeout;
|
|
59
|
+
if (timeoutExceeded) {
|
|
60
|
+
throw new HiveDriverError_1.default(`Hive driver: ${error.statusCode} when connecting to resource. Retry timeout exceeded.`);
|
|
61
|
+
}
|
|
62
|
+
yield delay(retryDelay);
|
|
63
|
+
return this.invokeWithErrorHandling(request, command, info);
|
|
64
|
+
// TODO: Here we should handle other error types (see PECO-730)
|
|
65
|
+
// no default
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Re-throw error we didn't handle
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
invokeCommand(request, command) {
|
|
75
|
+
if (typeof command !== 'function') {
|
|
76
|
+
return Promise.reject(new HiveDriverError_1.default('Hive driver: the operation does not exist, try to choose another Thrift file.'));
|
|
77
|
+
}
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
17
79
|
try {
|
|
18
80
|
command.call(this.client, request, (err, response) => {
|
|
19
81
|
if (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../lib/hive/Commands/BaseCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../lib/hive/Commands/BaseCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAAgC;AAEhC,mFAA2D;AAC3D,sEAA8C;AAO9C,SAAS,aAAa,CAAC,OAAe;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAA,GAAG,EAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,oBAAoB;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,sBAAY,CAAC,aAAa,GAAG,KAAK,EAAE,sBAAY,CAAC,aAAa,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,KAAK,CAAC,YAAoB;IACjC,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAA8B,WAAW;IAGvC,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAES,cAAc,CAAW,OAAe,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,uBAAuB,CAAW,OAAO,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,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gBAClC,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;IAEO,aAAa,CAAW,OAAe,EAAE,OAAwB;QACvE,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;YACjC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,yBAAe,CAAC,+EAA+E,CAAC,CACrG,CAAC;SACH;QAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI;gBACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAU,EAAE,QAAkB,EAAE,EAAE;oBACpE,IAAI,GAAG,EAAE;wBACP,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;yBAAM;wBACL,OAAO,CAAC,QAAQ,CAAC,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;aACJ;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,CAAC;aACf;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AArFD,8BAqFC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import TCLIService from '../../thrift/TCLIService';
|
|
2
2
|
import { TOpenSessionReq, TCloseSessionReq, TExecuteStatementReq, TGetResultSetMetadataReq, TFetchResultsReq, TGetInfoReq, TGetTypeInfoReq, TGetCatalogsReq, TGetSchemasReq, TGetTablesReq, TGetTableTypesReq, TGetColumnsReq, TGetFunctionsReq, TGetPrimaryKeysReq, TGetCrossReferenceReq, TGetOperationStatusReq, TCancelOperationReq, TCloseOperationReq, TGetDelegationTokenReq, TCancelDelegationTokenReq, TRenewDelegationTokenReq } from '../../thrift/TCLIService_types';
|
|
3
|
+
export type ClientFactory = () => Promise<TCLIService.Client>;
|
|
3
4
|
export default class HiveDriver {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
5
|
+
private readonly clientFactory;
|
|
6
|
+
constructor(clientFactory: ClientFactory);
|
|
6
7
|
openSession(request: TOpenSessionReq): Promise<import("../../thrift/TCLIService_types").TOpenSessionResp>;
|
|
7
8
|
closeSession(request: TCloseSessionReq): Promise<import("../../thrift/TCLIService_types").TCloseSessionResp>;
|
|
8
9
|
executeStatement(request: TExecuteStatementReq): Promise<import("../../thrift/TCLIService_types").TExecuteStatementResp>;
|
package/dist/hive/HiveDriver.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
@@ -25,92 +34,155 @@ const GetDelegationTokenCommand_1 = __importDefault(require("./Commands/GetDeleg
|
|
|
25
34
|
const CancelDelegationTokenCommand_1 = __importDefault(require("./Commands/CancelDelegationTokenCommand"));
|
|
26
35
|
const RenewDelegationTokenCommand_1 = __importDefault(require("./Commands/RenewDelegationTokenCommand"));
|
|
27
36
|
class HiveDriver {
|
|
28
|
-
constructor(
|
|
29
|
-
this.
|
|
37
|
+
constructor(clientFactory) {
|
|
38
|
+
this.clientFactory = clientFactory;
|
|
30
39
|
}
|
|
31
40
|
openSession(request) {
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const client = yield this.clientFactory();
|
|
43
|
+
const action = new OpenSessionCommand_1.default(client);
|
|
44
|
+
return action.execute(request);
|
|
45
|
+
});
|
|
34
46
|
}
|
|
35
47
|
closeSession(request) {
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const client = yield this.clientFactory();
|
|
50
|
+
const command = new CloseSessionCommand_1.default(client);
|
|
51
|
+
return command.execute(request);
|
|
52
|
+
});
|
|
38
53
|
}
|
|
39
54
|
executeStatement(request) {
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const client = yield this.clientFactory();
|
|
57
|
+
const command = new ExecuteStatementCommand_1.default(client);
|
|
58
|
+
return command.execute(request);
|
|
59
|
+
});
|
|
42
60
|
}
|
|
43
61
|
getResultSetMetadata(request) {
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const client = yield this.clientFactory();
|
|
64
|
+
const command = new GetResultSetMetadataCommand_1.default(client);
|
|
65
|
+
return command.execute(request);
|
|
66
|
+
});
|
|
46
67
|
}
|
|
47
68
|
fetchResults(request) {
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const client = yield this.clientFactory();
|
|
71
|
+
const command = new FetchResultsCommand_1.default(client);
|
|
72
|
+
return command.execute(request);
|
|
73
|
+
});
|
|
50
74
|
}
|
|
51
75
|
getInfo(request) {
|
|
52
|
-
|
|
53
|
-
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const client = yield this.clientFactory();
|
|
78
|
+
const command = new GetInfoCommand_1.default(client);
|
|
79
|
+
return command.execute(request);
|
|
80
|
+
});
|
|
54
81
|
}
|
|
55
82
|
getTypeInfo(request) {
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const client = yield this.clientFactory();
|
|
85
|
+
const command = new GetTypeInfoCommand_1.default(client);
|
|
86
|
+
return command.execute(request);
|
|
87
|
+
});
|
|
58
88
|
}
|
|
59
89
|
getCatalogs(request) {
|
|
60
|
-
|
|
61
|
-
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const client = yield this.clientFactory();
|
|
92
|
+
const command = new GetCatalogsCommand_1.default(client);
|
|
93
|
+
return command.execute(request);
|
|
94
|
+
});
|
|
62
95
|
}
|
|
63
96
|
getSchemas(request) {
|
|
64
|
-
|
|
65
|
-
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const client = yield this.clientFactory();
|
|
99
|
+
const command = new GetSchemasCommand_1.default(client);
|
|
100
|
+
return command.execute(request);
|
|
101
|
+
});
|
|
66
102
|
}
|
|
67
103
|
getTables(request) {
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const client = yield this.clientFactory();
|
|
106
|
+
const command = new GetTablesCommand_1.default(client);
|
|
107
|
+
return command.execute(request);
|
|
108
|
+
});
|
|
70
109
|
}
|
|
71
110
|
getTableTypes(request) {
|
|
72
|
-
|
|
73
|
-
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const client = yield this.clientFactory();
|
|
113
|
+
const command = new GetTableTypesCommand_1.default(client);
|
|
114
|
+
return command.execute(request);
|
|
115
|
+
});
|
|
74
116
|
}
|
|
75
117
|
getColumns(request) {
|
|
76
|
-
|
|
77
|
-
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const client = yield this.clientFactory();
|
|
120
|
+
const command = new GetColumnsCommand_1.default(client);
|
|
121
|
+
return command.execute(request);
|
|
122
|
+
});
|
|
78
123
|
}
|
|
79
124
|
getFunctions(request) {
|
|
80
|
-
|
|
81
|
-
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const client = yield this.clientFactory();
|
|
127
|
+
const command = new GetFunctionsCommand_1.default(client);
|
|
128
|
+
return command.execute(request);
|
|
129
|
+
});
|
|
82
130
|
}
|
|
83
131
|
getPrimaryKeys(request) {
|
|
84
|
-
|
|
85
|
-
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const client = yield this.clientFactory();
|
|
134
|
+
const command = new GetPrimaryKeysCommand_1.default(client);
|
|
135
|
+
return command.execute(request);
|
|
136
|
+
});
|
|
86
137
|
}
|
|
87
138
|
getCrossReference(request) {
|
|
88
|
-
|
|
89
|
-
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const client = yield this.clientFactory();
|
|
141
|
+
const command = new GetCrossReferenceCommand_1.default(client);
|
|
142
|
+
return command.execute(request);
|
|
143
|
+
});
|
|
90
144
|
}
|
|
91
145
|
getOperationStatus(request) {
|
|
92
|
-
|
|
93
|
-
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const client = yield this.clientFactory();
|
|
148
|
+
const command = new GetOperationStatusCommand_1.default(client);
|
|
149
|
+
return command.execute(request);
|
|
150
|
+
});
|
|
94
151
|
}
|
|
95
152
|
cancelOperation(request) {
|
|
96
|
-
|
|
97
|
-
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const client = yield this.clientFactory();
|
|
155
|
+
const command = new CancelOperationCommand_1.default(client);
|
|
156
|
+
return command.execute(request);
|
|
157
|
+
});
|
|
98
158
|
}
|
|
99
159
|
closeOperation(request) {
|
|
100
|
-
|
|
101
|
-
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
const client = yield this.clientFactory();
|
|
162
|
+
const command = new CloseOperationCommand_1.default(client);
|
|
163
|
+
return command.execute(request);
|
|
164
|
+
});
|
|
102
165
|
}
|
|
103
166
|
getDelegationToken(request) {
|
|
104
|
-
|
|
105
|
-
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const client = yield this.clientFactory();
|
|
169
|
+
const command = new GetDelegationTokenCommand_1.default(client);
|
|
170
|
+
return command.execute(request);
|
|
171
|
+
});
|
|
106
172
|
}
|
|
107
173
|
cancelDelegationToken(request) {
|
|
108
|
-
|
|
109
|
-
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const client = yield this.clientFactory();
|
|
176
|
+
const command = new CancelDelegationTokenCommand_1.default(client);
|
|
177
|
+
return command.execute(request);
|
|
178
|
+
});
|
|
110
179
|
}
|
|
111
180
|
renewDelegationToken(request) {
|
|
112
|
-
|
|
113
|
-
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const client = yield this.clientFactory();
|
|
183
|
+
const command = new RenewDelegationTokenCommand_1.default(client);
|
|
184
|
+
return command.execute(request);
|
|
185
|
+
});
|
|
114
186
|
}
|
|
115
187
|
}
|
|
116
188
|
exports.default = HiveDriver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiveDriver.js","sourceRoot":"","sources":["../../lib/hive/HiveDriver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HiveDriver.js","sourceRoot":"","sources":["../../lib/hive/HiveDriver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,uFAA+D;AAC/D,yFAAiE;AACjE,iGAAyE;AACzE,yGAAiF;AACjF,yFAAiE;AACjE,+EAAuD;AACvD,uFAA+D;AAC/D,uFAA+D;AAC/D,qFAA6D;AAC7D,mFAA2D;AAC3D,2FAAmE;AACnE,qFAA6D;AAC7D,yFAAiE;AACjE,6FAAqE;AACrE,mGAA2E;AAC3E,qGAA6E;AAC7E,+FAAuE;AACvE,6FAAqE;AACrE,qGAA6E;AAC7E,2GAAmF;AACnF,yGAAiF;AAIjF,MAAqB,UAAU;IAG7B,YAAY,aAA4B;QACtC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEK,WAAW,CAAC,OAAwB;;YACxC,MAA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AC;YACnD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;IAEK,cAAc,CAAC,OAA2B;;YAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,+BAAqB,CAAC,MAAM,CAAC,CAAC;YAClD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;IAEK,kBAAkB,CAAC,OAA+B;;YACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,mCAAyB,CAAC,MAAM,CAAC,CAAC;YACtD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;IAEK,qBAAqB,CAAC,OAAkC;;YAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,sCAA4B,CAAC,MAAM,CAAC,CAAC;YACzD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;IAEK,oBAAoB,CAAC,OAAiC;;YAC1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1C,MAAM,OAAO,GAAG,IAAI,qCAA2B,CAAC,MAAM,CAAC,CAAC;YACxD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;CACF;AApID,6BAoIC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,13 +4,11 @@ import TCLIService_types from '../thrift/TCLIService_types';
|
|
|
4
4
|
import DBSQLClient from './DBSQLClient';
|
|
5
5
|
import DBSQLSession from './DBSQLSession';
|
|
6
6
|
import DBSQLLogger from './DBSQLLogger';
|
|
7
|
-
import NoSaslAuthentication from './connection/auth/NoSaslAuthentication';
|
|
8
7
|
import PlainHttpAuthentication from './connection/auth/PlainHttpAuthentication';
|
|
9
8
|
import HttpConnection from './connection/connections/HttpConnection';
|
|
10
9
|
import { formatProgress } from './utils';
|
|
11
10
|
import { LogLevel } from './contracts/IDBSQLLogger';
|
|
12
11
|
export declare const auth: {
|
|
13
|
-
NoSaslAuthentication: typeof NoSaslAuthentication;
|
|
14
12
|
PlainHttpAuthentication: typeof PlainHttpAuthentication;
|
|
15
13
|
};
|
|
16
14
|
declare const TException: typeof Thrift.TException, TApplicationException: typeof Thrift.TApplicationException, TApplicationExceptionType: typeof Thrift.TApplicationExceptionType, TProtocolException: typeof Thrift.TProtocolException, TProtocolExceptionType: typeof Thrift.TProtocolExceptionType;
|
package/dist/index.js
CHANGED
|
@@ -13,14 +13,12 @@ const DBSQLSession_1 = __importDefault(require("./DBSQLSession"));
|
|
|
13
13
|
exports.DBSQLSession = DBSQLSession_1.default;
|
|
14
14
|
const DBSQLLogger_1 = __importDefault(require("./DBSQLLogger"));
|
|
15
15
|
exports.DBSQLLogger = DBSQLLogger_1.default;
|
|
16
|
-
const NoSaslAuthentication_1 = __importDefault(require("./connection/auth/NoSaslAuthentication"));
|
|
17
16
|
const PlainHttpAuthentication_1 = __importDefault(require("./connection/auth/PlainHttpAuthentication"));
|
|
18
17
|
const HttpConnection_1 = __importDefault(require("./connection/connections/HttpConnection"));
|
|
19
18
|
const utils_1 = require("./utils");
|
|
20
19
|
const IDBSQLLogger_1 = require("./contracts/IDBSQLLogger");
|
|
21
20
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return IDBSQLLogger_1.LogLevel; } });
|
|
22
21
|
exports.auth = {
|
|
23
|
-
NoSaslAuthentication: NoSaslAuthentication_1.default,
|
|
24
22
|
PlainHttpAuthentication: PlainHttpAuthentication_1.default,
|
|
25
23
|
};
|
|
26
24
|
const { TException, TApplicationException, TApplicationExceptionType, TProtocolException, TProtocolExceptionType } = thrift_1.Thrift;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAChC,wEAAgD;AAChD,oFAA4D;AAC5D,gEAAwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAChC,wEAAgD;AAChD,oFAA4D;AAC5D,gEAAwC;AA8B/B,sBA9BF,qBAAW,CA8BE;AA7BpB,kEAA0C;AA6BpB,uBA7Bf,sBAAY,CA6Be;AA5BlC,gEAAwC;AA4BJ,sBA5B7B,qBAAW,CA4B6B;AA3B/C,wGAAgF;AAChF,6FAAqE;AACrE,mCAAyC;AACzC,2DAAoD;AAwBH,yFAxBxC,uBAAQ,OAwBwC;AAtB5C,QAAA,IAAI,GAAG;IAClB,uBAAuB,EAAvB,iCAAuB;CACxB,CAAC;AAEF,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,GAChH,eAAM,CAAC;AAEA,gCAAU;AAAE,sDAAqB;AAAE,8DAAyB;AAAE,gDAAkB;AAAE,wDAAsB;AAEpG,QAAA,WAAW,GAAG;IACzB,cAAc,EAAd,wBAAc;CACf,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,WAAW,EAAX,qBAAW;IACX,iBAAiB,EAAjB,2BAAiB;CAClB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,cAAc,EAAd,sBAAc;CACf,CAAC"}
|
|
@@ -241,6 +241,14 @@ HttpConnection.prototype.write = function(data, seqid) {
|
|
|
241
241
|
var req = (self.https) ?
|
|
242
242
|
https.request(opts, responseCallback) :
|
|
243
243
|
http.request(opts, responseCallback);
|
|
244
|
+
req.on('timeout', () => {
|
|
245
|
+
// Ignore all subsequent errors on this request
|
|
246
|
+
req.off('error', handleError);
|
|
247
|
+
req.on('error', () => {});
|
|
248
|
+
// Emit a single error and destroy request
|
|
249
|
+
handleError(new thrift.TApplicationException(thrift.TApplicationExceptionType.PROTOCOL_ERROR, 'Request timed out'));
|
|
250
|
+
req.destroy();
|
|
251
|
+
});
|
|
244
252
|
req.on('error', handleError);
|
|
245
253
|
req.write(data);
|
|
246
254
|
req.end();
|
|
@@ -6,8 +6,9 @@ export default class ArrowResult implements IOperationResult {
|
|
|
6
6
|
private readonly schema;
|
|
7
7
|
private readonly arrowSchema?;
|
|
8
8
|
constructor(schema?: TTableSchema, arrowSchema?: Buffer);
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
hasPendingData(): Promise<boolean>;
|
|
10
|
+
getValue(data?: Array<TRowSet>): Promise<any[]>;
|
|
11
|
+
protected getBatches(data: Array<TRowSet>): Promise<Array<Buffer>>;
|
|
11
12
|
private getRows;
|
|
12
13
|
private convertArrowTypes;
|
|
13
14
|
private convertThriftTypes;
|