Skip to content

Commit 47d7151

Browse files
Remove protocol version check for query parameters (#213)
* Remove protocol version check for query parameters Signed-off-by: Levko Kravets <levko.ne@gmail.com> * Re-enable query parameters tests Signed-off-by: Levko Kravets <levko.ne@gmail.com> --------- Signed-off-by: Levko Kravets <levko.ne@gmail.com>
1 parent 4fbe55b commit 47d7151

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

lib/DBSQLSession.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import { stringify, NIL, parse } from 'uuid';
44
import fetch, { HeadersInit } from 'node-fetch';
5-
import { Thrift } from 'thrift';
65
import {
76
TSessionHandle,
87
TStatus,
98
TOperationHandle,
109
TSparkDirectResults,
1110
TSparkArrowTypes,
1211
TSparkParameter,
13-
TProtocolVersion,
1412
} from '../thrift/TCLIService_types';
1513
import { Int64 } from './hive/Types';
1614
import IDBSQLSession, {
@@ -98,16 +96,6 @@ function getQueryParameters(
9896
return [];
9997
}
10098

101-
if (
102-
!sessionHandle.serverProtocolVersion ||
103-
sessionHandle.serverProtocolVersion < TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8
104-
) {
105-
throw new Thrift.TProtocolException(
106-
Thrift.TProtocolExceptionType.BAD_VERSION,
107-
'Parameterized operations are not supported by this server. Support will begin with server version DBR 14.1',
108-
);
109-
}
110-
11199
const result: Array<TSparkParameter> = [];
112100

113101
if (namedParameters !== undefined) {

tests/e2e/query_parameters.test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ const openSession = async () => {
1919
});
2020
};
2121

22-
// TODO: Temporarily disable those tests until we figure out issues with E2E test env
2322
describe('Query parameters', () => {
24-
it.skip('should use named parameters', async () => {
23+
it('should use named parameters', async () => {
2524
const session = await openSession();
2625
const operation = await session.executeStatement(
2726
`
@@ -72,7 +71,7 @@ describe('Query parameters', () => {
7271
]);
7372
});
7473

75-
it.skip('should accept primitives as values for named parameters', async () => {
74+
it('should accept primitives as values for named parameters', async () => {
7675
const session = await openSession();
7776
const operation = await session.executeStatement(
7877
`
@@ -117,7 +116,7 @@ describe('Query parameters', () => {
117116
]);
118117
});
119118

120-
it.skip('should use ordinal parameters', async () => {
119+
it('should use ordinal parameters', async () => {
121120
const session = await openSession();
122121
const operation = await session.executeStatement(
123122
`
@@ -168,7 +167,7 @@ describe('Query parameters', () => {
168167
]);
169168
});
170169

171-
it.skip('should accept primitives as values for ordinal parameters', async () => {
170+
it('should accept primitives as values for ordinal parameters', async () => {
172171
const session = await openSession();
173172
const operation = await session.executeStatement(
174173
`

0 commit comments

Comments
 (0)