@databricks/sql 1.8.4 → 1.10.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 -5
- package/dist/DBSQLClient.js +78 -83
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLLogger.js +2 -13
- package/dist/DBSQLLogger.js.map +1 -1
- package/dist/DBSQLOperation.d.ts +6 -1
- package/dist/DBSQLOperation.js +223 -234
- package/dist/DBSQLOperation.js.map +1 -1
- package/dist/DBSQLSession.d.ts +2 -0
- package/dist/DBSQLSession.js +276 -229
- package/dist/DBSQLSession.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.d.ts +7 -2
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js +91 -104
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js +114 -134
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/OAuthPersistence.js +4 -17
- package/dist/connection/auth/DatabricksOAuth/OAuthPersistence.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/index.d.ts +3 -2
- package/dist/connection/auth/DatabricksOAuth/index.js +19 -22
- package/dist/connection/auth/DatabricksOAuth/index.js.map +1 -1
- package/dist/connection/auth/PlainHttpAuthentication.js +5 -13
- package/dist/connection/auth/PlainHttpAuthentication.js.map +1 -1
- package/dist/connection/connections/HttpConnection.d.ts +1 -1
- package/dist/connection/connections/HttpConnection.js +49 -46
- package/dist/connection/connections/HttpConnection.js.map +1 -1
- package/dist/connection/connections/HttpRetryPolicy.d.ts +1 -1
- package/dist/connection/connections/HttpRetryPolicy.js +28 -41
- package/dist/connection/connections/HttpRetryPolicy.js.map +1 -1
- package/dist/connection/connections/NullRetryPolicy.js +5 -18
- package/dist/connection/connections/NullRetryPolicy.js.map +1 -1
- package/dist/connection/connections/ThriftHttpConnection.js +22 -20
- package/dist/connection/connections/ThriftHttpConnection.js.map +1 -1
- package/dist/connection/contracts/IConnectionProvider.d.ts +1 -1
- package/dist/contracts/IClientContext.d.ts +4 -2
- package/dist/contracts/IDBSQLClient.d.ts +1 -1
- package/dist/contracts/IDBSQLSession.d.ts +17 -13
- package/dist/contracts/IOperation.d.ts +19 -0
- package/dist/contracts/IThriftClient.d.ts +8 -0
- package/dist/contracts/IThriftClient.js +3 -0
- package/dist/contracts/IThriftClient.js.map +1 -0
- package/dist/dto/InfoValue.d.ts +1 -2
- package/dist/hive/Commands/BaseCommand.d.ts +3 -4
- package/dist/hive/Commands/BaseCommand.js +22 -33
- package/dist/hive/Commands/BaseCommand.js.map +1 -1
- package/dist/hive/Commands/CancelDelegationTokenCommand.d.ts +4 -1
- package/dist/hive/Commands/CancelDelegationTokenCommand.js.map +1 -1
- package/dist/hive/Commands/CancelOperationCommand.d.ts +4 -1
- package/dist/hive/Commands/CancelOperationCommand.js.map +1 -1
- package/dist/hive/Commands/CloseOperationCommand.d.ts +4 -1
- package/dist/hive/Commands/CloseOperationCommand.js.map +1 -1
- package/dist/hive/Commands/CloseSessionCommand.d.ts +4 -1
- package/dist/hive/Commands/CloseSessionCommand.js.map +1 -1
- package/dist/hive/Commands/ExecuteStatementCommand.d.ts +4 -1
- package/dist/hive/Commands/ExecuteStatementCommand.js.map +1 -1
- package/dist/hive/Commands/FetchResultsCommand.d.ts +4 -1
- package/dist/hive/Commands/FetchResultsCommand.js.map +1 -1
- package/dist/hive/Commands/GetCatalogsCommand.d.ts +4 -1
- package/dist/hive/Commands/GetCatalogsCommand.js.map +1 -1
- package/dist/hive/Commands/GetColumnsCommand.d.ts +4 -1
- package/dist/hive/Commands/GetColumnsCommand.js.map +1 -1
- package/dist/hive/Commands/GetCrossReferenceCommand.d.ts +4 -1
- package/dist/hive/Commands/GetCrossReferenceCommand.js.map +1 -1
- package/dist/hive/Commands/GetDelegationTokenCommand.d.ts +4 -1
- package/dist/hive/Commands/GetDelegationTokenCommand.js.map +1 -1
- package/dist/hive/Commands/GetFunctionsCommand.d.ts +4 -1
- package/dist/hive/Commands/GetFunctionsCommand.js.map +1 -1
- package/dist/hive/Commands/GetInfoCommand.d.ts +4 -1
- package/dist/hive/Commands/GetInfoCommand.js.map +1 -1
- package/dist/hive/Commands/GetOperationStatusCommand.d.ts +4 -1
- package/dist/hive/Commands/GetOperationStatusCommand.js.map +1 -1
- package/dist/hive/Commands/GetPrimaryKeysCommand.d.ts +4 -1
- package/dist/hive/Commands/GetPrimaryKeysCommand.js.map +1 -1
- package/dist/hive/Commands/GetResultSetMetadataCommand.d.ts +4 -1
- package/dist/hive/Commands/GetResultSetMetadataCommand.js.map +1 -1
- package/dist/hive/Commands/GetSchemasCommand.d.ts +4 -1
- package/dist/hive/Commands/GetSchemasCommand.js.map +1 -1
- package/dist/hive/Commands/GetTableTypesCommand.d.ts +4 -1
- package/dist/hive/Commands/GetTableTypesCommand.js.map +1 -1
- package/dist/hive/Commands/GetTablesCommand.d.ts +4 -1
- package/dist/hive/Commands/GetTablesCommand.js.map +1 -1
- package/dist/hive/Commands/GetTypeInfoCommand.d.ts +4 -1
- package/dist/hive/Commands/GetTypeInfoCommand.js.map +1 -1
- package/dist/hive/Commands/OpenSessionCommand.d.ts +4 -1
- package/dist/hive/Commands/OpenSessionCommand.js.map +1 -1
- package/dist/hive/Commands/RenewDelegationTokenCommand.d.ts +4 -1
- package/dist/hive/Commands/RenewDelegationTokenCommand.js.map +1 -1
- package/dist/hive/HiveDriver.js +104 -155
- package/dist/hive/HiveDriver.js.map +1 -1
- package/dist/polyfills.d.ts +1 -1
- package/dist/polyfills.js +1 -1
- package/dist/polyfills.js.map +1 -1
- package/dist/result/ArrowResultConverter.d.ts +1 -1
- package/dist/result/ArrowResultConverter.js +69 -84
- package/dist/result/ArrowResultConverter.js.map +1 -1
- package/dist/result/ArrowResultHandler.d.ts +1 -1
- package/dist/result/ArrowResultHandler.js +28 -41
- package/dist/result/ArrowResultHandler.js.map +1 -1
- package/dist/result/CloudFetchResultHandler.d.ts +1 -1
- package/dist/result/CloudFetchResultHandler.js +48 -65
- package/dist/result/CloudFetchResultHandler.js.map +1 -1
- package/dist/result/JsonResultHandler.d.ts +0 -1
- package/dist/result/JsonResultHandler.js +14 -41
- package/dist/result/JsonResultHandler.js.map +1 -1
- package/dist/result/ResultSlicer.js +40 -53
- package/dist/result/ResultSlicer.js.map +1 -1
- package/dist/result/RowSetProvider.d.ts +4 -0
- package/dist/result/RowSetProvider.js +42 -59
- package/dist/result/RowSetProvider.js.map +1 -1
- package/dist/result/utils.d.ts +2 -1
- package/dist/result/utils.js +9 -1
- package/dist/result/utils.js.map +1 -1
- package/dist/utils/CloseableCollection.js +7 -18
- package/dist/utils/CloseableCollection.js.map +1 -1
- package/dist/utils/OperationIterator.d.ts +23 -0
- package/dist/utils/OperationIterator.js +71 -0
- package/dist/utils/OperationIterator.js.map +1 -0
- package/dist/utils/buildUserAgentString.d.ts +1 -1
- package/dist/utils/buildUserAgentString.js +14 -2
- package/dist/utils/buildUserAgentString.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +12 -7
- package/thrift/TCLIService.d.ts +0 -42
- package/dist/hive/Types/index.d.ts +0 -18
- package/dist/hive/Types/index.js +0 -25
- package/dist/hive/Types/index.js.map +0 -1
|
@@ -4,7 +4,7 @@ import IClientContext from '../contracts/IClientContext';
|
|
|
4
4
|
import IResultsProvider, { ResultsProviderFetchNextOptions } from './IResultsProvider';
|
|
5
5
|
import { ArrowBatch } from './utils';
|
|
6
6
|
export default class ArrowResultHandler implements IResultsProvider<ArrowBatch> {
|
|
7
|
-
|
|
7
|
+
private readonly context;
|
|
8
8
|
private readonly source;
|
|
9
9
|
private readonly arrowSchema?;
|
|
10
10
|
private readonly isLZ4Compressed;
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -27,43 +18,39 @@ class ArrowResultHandler {
|
|
|
27
18
|
throw new HiveDriverError_1.default('Cannot handle LZ4 compressed result: module `lz4` not installed');
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
|
-
hasMore() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return this.source.hasMore();
|
|
36
|
-
});
|
|
21
|
+
async hasMore() {
|
|
22
|
+
if (!this.arrowSchema) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return this.source.hasMore();
|
|
37
26
|
}
|
|
38
|
-
fetchNext(options) {
|
|
27
|
+
async fetchNext(options) {
|
|
39
28
|
var _a;
|
|
40
|
-
|
|
41
|
-
if (!this.arrowSchema) {
|
|
42
|
-
return {
|
|
43
|
-
batches: [],
|
|
44
|
-
rowCount: 0,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const rowSet = yield this.source.fetchNext(options);
|
|
48
|
-
const batches = [];
|
|
49
|
-
let totalRowCount = 0;
|
|
50
|
-
(_a = rowSet === null || rowSet === void 0 ? void 0 : rowSet.arrowBatches) === null || _a === void 0 ? void 0 : _a.forEach(({ batch, rowCount }) => {
|
|
51
|
-
if (batch) {
|
|
52
|
-
batches.push(this.isLZ4Compressed ? utils_2.LZ4.decode(batch) : batch);
|
|
53
|
-
totalRowCount += rowCount.toNumber(true);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
if (batches.length === 0) {
|
|
57
|
-
return {
|
|
58
|
-
batches: [],
|
|
59
|
-
rowCount: 0,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
29
|
+
if (!this.arrowSchema) {
|
|
62
30
|
return {
|
|
63
|
-
batches: [
|
|
64
|
-
rowCount:
|
|
31
|
+
batches: [],
|
|
32
|
+
rowCount: 0,
|
|
65
33
|
};
|
|
34
|
+
}
|
|
35
|
+
const rowSet = await this.source.fetchNext(options);
|
|
36
|
+
const batches = [];
|
|
37
|
+
let totalRowCount = 0;
|
|
38
|
+
(_a = rowSet === null || rowSet === void 0 ? void 0 : rowSet.arrowBatches) === null || _a === void 0 ? void 0 : _a.forEach(({ batch, rowCount }) => {
|
|
39
|
+
if (batch) {
|
|
40
|
+
batches.push(this.isLZ4Compressed ? utils_2.LZ4.decode(batch) : batch);
|
|
41
|
+
totalRowCount += rowCount.toNumber(true);
|
|
42
|
+
}
|
|
66
43
|
});
|
|
44
|
+
if (batches.length === 0) {
|
|
45
|
+
return {
|
|
46
|
+
batches: [],
|
|
47
|
+
rowCount: 0,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
batches: [this.arrowSchema, ...batches],
|
|
52
|
+
rowCount: totalRowCount,
|
|
53
|
+
};
|
|
67
54
|
}
|
|
68
55
|
}
|
|
69
56
|
exports.default = ArrowResultHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrowResultHandler.js","sourceRoot":"","sources":["../../lib/result/ArrowResultHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArrowResultHandler.js","sourceRoot":"","sources":["../../lib/result/ArrowResultHandler.ts"],"names":[],"mappings":";;;;;AACA,g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C,eAAe,CAAC,CAAC,CAAC,WAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAChE,aAAa,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aAC1C;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,OAAO;gBACL,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,CAAC;aACZ,CAAC;SACH;QAED,OAAO;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC;YACvC,QAAQ,EAAE,aAAa;SACxB,CAAC;IACJ,CAAC;CACF;AAhED,qCAgEC"}
|
|
@@ -3,7 +3,7 @@ import IClientContext from '../contracts/IClientContext';
|
|
|
3
3
|
import IResultsProvider, { ResultsProviderFetchNextOptions } from './IResultsProvider';
|
|
4
4
|
import { ArrowBatch } from './utils';
|
|
5
5
|
export default class CloudFetchResultHandler implements IResultsProvider<ArrowBatch> {
|
|
6
|
-
|
|
6
|
+
private readonly context;
|
|
7
7
|
private readonly source;
|
|
8
8
|
private readonly isLZ4Compressed;
|
|
9
9
|
private pendingLinks;
|
|
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
@@ -49,69 +40,61 @@ class CloudFetchResultHandler {
|
|
|
49
40
|
throw new HiveDriverError_1.default('Cannot handle LZ4 compressed result: module `lz4` not installed');
|
|
50
41
|
}
|
|
51
42
|
}
|
|
52
|
-
hasMore() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return this.source.hasMore();
|
|
58
|
-
});
|
|
43
|
+
async hasMore() {
|
|
44
|
+
if (this.pendingLinks.length > 0 || this.downloadTasks.length > 0) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return this.source.hasMore();
|
|
59
48
|
}
|
|
60
|
-
fetchNext(options) {
|
|
49
|
+
async fetchNext(options) {
|
|
61
50
|
var _a;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.pendingLinks.push(link);
|
|
66
|
-
});
|
|
67
|
-
const clientConfig = this.context.getConfig();
|
|
68
|
-
const freeTaskSlotsCount = clientConfig.cloudFetchConcurrentDownloads - this.downloadTasks.length;
|
|
69
|
-
if (freeTaskSlotsCount > 0) {
|
|
70
|
-
const links = this.pendingLinks.splice(0, freeTaskSlotsCount);
|
|
71
|
-
const tasks = links.map((link) => this.downloadLink(link));
|
|
72
|
-
this.downloadTasks.push(...tasks);
|
|
73
|
-
}
|
|
74
|
-
const batch = yield this.downloadTasks.shift();
|
|
75
|
-
if (!batch) {
|
|
76
|
-
return {
|
|
77
|
-
batches: [],
|
|
78
|
-
rowCount: 0,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
if (this.isLZ4Compressed) {
|
|
82
|
-
batch.batches = batch.batches.map((buffer) => utils_1.LZ4.decode(buffer));
|
|
83
|
-
}
|
|
84
|
-
return batch;
|
|
51
|
+
const data = await this.source.fetchNext(options);
|
|
52
|
+
(_a = data === null || data === void 0 ? void 0 : data.resultLinks) === null || _a === void 0 ? void 0 : _a.forEach((link) => {
|
|
53
|
+
this.pendingLinks.push(link);
|
|
85
54
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
const result = yield response.arrayBuffer();
|
|
55
|
+
const clientConfig = this.context.getConfig();
|
|
56
|
+
const freeTaskSlotsCount = clientConfig.cloudFetchConcurrentDownloads - this.downloadTasks.length;
|
|
57
|
+
if (freeTaskSlotsCount > 0) {
|
|
58
|
+
const links = this.pendingLinks.splice(0, freeTaskSlotsCount);
|
|
59
|
+
const tasks = links.map((link) => this.downloadLink(link));
|
|
60
|
+
this.downloadTasks.push(...tasks);
|
|
61
|
+
}
|
|
62
|
+
const batch = await this.downloadTasks.shift();
|
|
63
|
+
if (!batch) {
|
|
97
64
|
return {
|
|
98
|
-
batches: [
|
|
99
|
-
rowCount:
|
|
65
|
+
batches: [],
|
|
66
|
+
rowCount: 0,
|
|
100
67
|
};
|
|
101
|
-
}
|
|
68
|
+
}
|
|
69
|
+
if (this.isLZ4Compressed) {
|
|
70
|
+
batch.batches = batch.batches.map((buffer) => utils_1.LZ4.decode(buffer));
|
|
71
|
+
}
|
|
72
|
+
return batch;
|
|
73
|
+
}
|
|
74
|
+
async downloadLink(link) {
|
|
75
|
+
if (Date.now() >= link.expiryTime.toNumber()) {
|
|
76
|
+
throw new Error('CloudFetch link has expired');
|
|
77
|
+
}
|
|
78
|
+
const response = await this.fetch(link.fileLink, { headers: link.httpHeaders });
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
throw new Error(`CloudFetch HTTP error ${response.status} ${response.statusText}`);
|
|
81
|
+
}
|
|
82
|
+
const result = await response.arrayBuffer();
|
|
83
|
+
return {
|
|
84
|
+
batches: [Buffer.from(result)],
|
|
85
|
+
rowCount: link.rowCount.toNumber(true),
|
|
86
|
+
};
|
|
102
87
|
}
|
|
103
|
-
fetch(url, init) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
return (0, node_fetch_1.default)(request).then((response) => ({ request, response }));
|
|
112
|
-
});
|
|
113
|
-
return result.response;
|
|
88
|
+
async fetch(url, init) {
|
|
89
|
+
const connectionProvider = await this.context.getConnectionProvider();
|
|
90
|
+
const agent = await connectionProvider.getAgent();
|
|
91
|
+
const retryPolicy = await connectionProvider.getRetryPolicy();
|
|
92
|
+
const requestConfig = { agent, ...init };
|
|
93
|
+
const result = await retryPolicy.invokeWithRetry(() => {
|
|
94
|
+
const request = new node_fetch_1.Request(url, requestConfig);
|
|
95
|
+
return (0, node_fetch_1.default)(request).then((response) => ({ request, response }));
|
|
114
96
|
});
|
|
97
|
+
return result.response;
|
|
115
98
|
}
|
|
116
99
|
}
|
|
117
100
|
exports.default = CloudFetchResultHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudFetchResultHandler.js","sourceRoot":"","sources":["../../lib/result/CloudFetchResultHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CloudFetchResultHandler.js","sourceRoot":"","sources":["../../lib/result/CloudFetchResultHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAsE;AAEtE,gFAAwD;AAIxD,oCAA+B;AAE/B,MAAqB,uBAAuB;IAW1C,YACE,OAAuB,EACvB,MAA6C,EAC7C,EAAE,aAAa,EAA6B;QAPtC,iBAAY,GAAiC,EAAE,CAAC;QAEhD,kBAAa,GAA+B,EAAE,CAAC;QAOrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,aAAa,aA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Q,EAAE,CAAC;QAClD,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,cAAc,EAAE,CAAC;QAE9D,MAAM,aAAa,GAAgB,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,CAAC;QACtD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE;YACpD,MAAM,OAAO,GAAG,IAAI,oBAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;YAChD,OAAO,IAAA,oBAAK,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;CACF;AA3FD,0CA2FC"}
|
|
@@ -1,15 +1,5 @@
|
|
|
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
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Types_1 = require("../hive/Types");
|
|
13
3
|
const utils_1 = require("./utils");
|
|
14
4
|
class JsonResultHandler {
|
|
15
5
|
constructor(context, source, { schema }) {
|
|
@@ -17,23 +7,19 @@ class JsonResultHandler {
|
|
|
17
7
|
this.source = source;
|
|
18
8
|
this.schema = (0, utils_1.getSchemaColumns)(schema);
|
|
19
9
|
}
|
|
20
|
-
hasMore() {
|
|
21
|
-
return
|
|
22
|
-
return this.source.hasMore();
|
|
23
|
-
});
|
|
10
|
+
async hasMore() {
|
|
11
|
+
return this.source.hasMore();
|
|
24
12
|
}
|
|
25
|
-
fetchNext(options) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return this.getRows(columns, this.schema);
|
|
36
|
-
});
|
|
13
|
+
async fetchNext(options) {
|
|
14
|
+
if (this.schema.length === 0) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const data = await this.source.fetchNext(options);
|
|
18
|
+
if (!data) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const columns = data.columns || [];
|
|
22
|
+
return this.getRows(columns, this.schema);
|
|
37
23
|
}
|
|
38
24
|
getRows(columns, descriptors) {
|
|
39
25
|
return descriptors.reduce((rows, descriptor) => this.getSchemaValues(descriptor, columns[descriptor.position - 1]).reduce((result, value, i) => {
|
|
@@ -48,7 +34,7 @@ class JsonResultHandler {
|
|
|
48
34
|
getSchemaValues(descriptor, column) {
|
|
49
35
|
var _a;
|
|
50
36
|
const typeDescriptor = (_a = descriptor.typeDesc.types[0]) === null || _a === void 0 ? void 0 : _a.primitiveEntry;
|
|
51
|
-
const columnValue =
|
|
37
|
+
const columnValue = (0, utils_1.getColumnValue)(column);
|
|
52
38
|
if (!columnValue) {
|
|
53
39
|
return [];
|
|
54
40
|
}
|
|
@@ -61,22 +47,9 @@ class JsonResultHandler {
|
|
|
61
47
|
}
|
|
62
48
|
isNull(nulls, i) {
|
|
63
49
|
const byte = nulls[Math.floor(i / 8)];
|
|
64
|
-
const ofs =
|
|
50
|
+
const ofs = 2 ** (i % 8);
|
|
65
51
|
return (byte & ofs) !== 0;
|
|
66
52
|
}
|
|
67
|
-
getColumnValue(column) {
|
|
68
|
-
if (!column) {
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
return (column[Types_1.ColumnCode.binaryVal] ||
|
|
72
|
-
column[Types_1.ColumnCode.boolVal] ||
|
|
73
|
-
column[Types_1.ColumnCode.byteVal] ||
|
|
74
|
-
column[Types_1.ColumnCode.doubleVal] ||
|
|
75
|
-
column[Types_1.ColumnCode.i16Val] ||
|
|
76
|
-
column[Types_1.ColumnCode.i32Val] ||
|
|
77
|
-
column[Types_1.ColumnCode.i64Val] ||
|
|
78
|
-
column[Types_1.ColumnCode.stringVal]);
|
|
79
|
-
}
|
|
80
53
|
}
|
|
81
54
|
exports.default = JsonResultHandler;
|
|
82
55
|
//# sourceMappingURL=JsonResultHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonResultHandler.js","sourceRoot":"","sources":["../../lib/result/JsonResultHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonResultHandler.js","sourceRoot":"","sources":["../../lib/result/JsonResultHandler.ts"],"names":[],"mappings":";;AAGA,mCAA+E;AAE/E,MAAqB,iBAAiB;IAOpC,YACE,OAAuB,EACvB,MAA6C,EAC7C,EAAE,MAAM,EAA6B;QAErC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAAwC;QAC7D,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACl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BAC1D,OAAO,IAAI,CAAC;aACb;YACD,OAAO,IAAA,0BAAkB,EAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,KAAa,EAAE,CAAS;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAEzB,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF;AA3ED,oCA2EC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
class ResultSlicer {
|
|
13
4
|
constructor(context, source) {
|
|
@@ -15,56 +6,52 @@ class ResultSlicer {
|
|
|
15
6
|
this.context = context;
|
|
16
7
|
this.source = source;
|
|
17
8
|
}
|
|
18
|
-
hasMore() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return this.source.hasMore();
|
|
24
|
-
});
|
|
9
|
+
async hasMore() {
|
|
10
|
+
if (this.remainingResults.length > 0) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return this.source.hasMore();
|
|
25
14
|
}
|
|
26
|
-
fetchNext(options) {
|
|
15
|
+
async fetchNext(options) {
|
|
27
16
|
var _a;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (options.disableBuffering) {
|
|
32
|
-
if (this.remainingResults.length > 0) {
|
|
33
|
-
const result = this.remainingResults;
|
|
34
|
-
this.remainingResults = [];
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
return this.source.fetchNext(options);
|
|
38
|
-
}
|
|
39
|
-
const result = [];
|
|
40
|
-
let resultsCount = 0;
|
|
41
|
-
// First, use remaining items from the previous fetch
|
|
17
|
+
// If we're asked to not use buffer - first try to return whatever we have in buffer.
|
|
18
|
+
// If buffer is empty - just proxy the call to underlying results provider
|
|
19
|
+
if (options.disableBuffering) {
|
|
42
20
|
if (this.remainingResults.length > 0) {
|
|
43
|
-
result
|
|
44
|
-
resultsCount += this.remainingResults.length;
|
|
21
|
+
const result = this.remainingResults;
|
|
45
22
|
this.remainingResults = [];
|
|
23
|
+
return result;
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
result.push(lastChunk.splice(0, neededCount));
|
|
64
|
-
this.remainingResults = lastChunk;
|
|
25
|
+
return this.source.fetchNext(options);
|
|
26
|
+
}
|
|
27
|
+
const result = [];
|
|
28
|
+
let resultsCount = 0;
|
|
29
|
+
// First, use remaining items from the previous fetch
|
|
30
|
+
if (this.remainingResults.length > 0) {
|
|
31
|
+
result.push(this.remainingResults);
|
|
32
|
+
resultsCount += this.remainingResults.length;
|
|
33
|
+
this.remainingResults = [];
|
|
34
|
+
}
|
|
35
|
+
// Fetch items from source results provider until we reach a requested count
|
|
36
|
+
while (resultsCount < options.limit) {
|
|
37
|
+
// eslint-disable-next-line no-await-in-loop
|
|
38
|
+
const hasMore = await this.source.hasMore();
|
|
39
|
+
if (!hasMore) {
|
|
40
|
+
break;
|
|
65
41
|
}
|
|
66
|
-
|
|
67
|
-
|
|
42
|
+
// eslint-disable-next-line no-await-in-loop
|
|
43
|
+
const chunk = await this.source.fetchNext(options);
|
|
44
|
+
result.push(chunk);
|
|
45
|
+
resultsCount += chunk.length;
|
|
46
|
+
}
|
|
47
|
+
// If we collected more results than requested, slice the excess items and store them for the next time
|
|
48
|
+
if (resultsCount > options.limit) {
|
|
49
|
+
const lastChunk = (_a = result.pop()) !== null && _a !== void 0 ? _a : [];
|
|
50
|
+
const neededCount = options.limit - (resultsCount - lastChunk.length);
|
|
51
|
+
result.push(lastChunk.splice(0, neededCount));
|
|
52
|
+
this.remainingResults = lastChunk;
|
|
53
|
+
}
|
|
54
|
+
return result.flat();
|
|
68
55
|
}
|
|
69
56
|
}
|
|
70
57
|
exports.default = ResultSlicer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultSlicer.js","sourceRoot":"","sources":["../../lib/result/ResultSlicer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResultSlicer.js","sourceRoot":"","sources":["../../lib/result/ResultSlicer.ts"],"names":[],"mappings":";;AASA,MAAqB,YAAY;IAO/B,YAAY,OAAuB,EAAE,MAAkC;QAF/D,qBAAgB,GAAa,EAAE,CAAC;QAGtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/B,CAA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MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;YACtE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;SACnC;QAED,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;CACF;AAlED,+BAkEC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { TFetchResultsResp, TOperationHandle, TRowSet } from '../../thrift/TCLIService_types';
|
|
2
2
|
import IClientContext from '../contracts/IClientContext';
|
|
3
3
|
import IResultsProvider, { ResultsProviderFetchNextOptions } from './IResultsProvider';
|
|
4
|
+
export declare enum FetchType {
|
|
5
|
+
Data = 0,
|
|
6
|
+
Logs = 1
|
|
7
|
+
}
|
|
4
8
|
export default class RowSetProvider implements IResultsProvider<TRowSet | undefined> {
|
|
5
9
|
private readonly context;
|
|
6
10
|
private readonly operationHandle;
|