diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d13bf63..8c6f2b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.11.0 + +- Enable cloud fetch by default (databricks/databricks-sql-nodejs#287) +- Added `useLZ4Compression` in `ExecuteStatementOptions` making compression configurable (databricks/databricks-sql-nodejs#288) +- Improve handling of extra `/` in URLs. Fixes [#284](https://github.com/databricks/databricks-sql-nodejs/issues/284) (databricks/databricks-sql-nodejs#290) +- Add thrift protocol version handling for driver features (databricks/databricks-sql-nodejs#292) +- Cleanup thrift fields that might be deprecated/removed in the future (databricks/databricks-sql-nodejs#295) +- Add lenient LZ4 check to handle dependecy errors gracefully. Fixes [#289](https://github.com/databricks/databricks-sql-nodejs/issues/289) [#275](https://github.com/databricks/databricks-sql-nodejs/issues/275) [#266](https://github.com/databricks/databricks-sql-nodejs/issues/266) [#270](https://github.com/databricks/databricks-sql-nodejs/issues/270) (databricks/databricks-sql-nodejs#298) + ## 1.10.0 - Rename `clientId` parameter to `userAgentEntry` in connect call to standardize across sql drivers (databricks/databricks-sql-nodejs#281) diff --git a/lib/DBSQLClient.ts b/lib/DBSQLClient.ts index 85888d16..0d2dc479 100644 --- a/lib/DBSQLClient.ts +++ b/lib/DBSQLClient.ts @@ -88,7 +88,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I retryDelayMin: 1 * 1000, // 1 second retryDelayMax: 60 * 1000, // 60 seconds (1 minute) - useCloudFetch: false, + useCloudFetch: true, // enabling cloud fetch by default. cloudFetchConcurrentDownloads: 10, useLZ4Compression: true, @@ -227,6 +227,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I const session = new DBSQLSession({ handle: definedOrError(response.sessionHandle), context: this, + serverProtocolVersion: response.serverProtocolVersion, }); this.sessions.add(session); return session; diff --git a/lib/DBSQLSession.ts b/lib/DBSQLSession.ts index 768b6b5e..d88331a1 100644 --- a/lib/DBSQLSession.ts +++ b/lib/DBSQLSession.ts @@ -12,6 +12,8 @@ import { TSparkDirectResults, TSparkArrowTypes, TSparkParameter, + TProtocolVersion, + TExecuteStatementReq, } from '../thrift/TCLIService_types'; import IDBSQLSession, { ExecuteStatementOptions, @@ -29,7 +31,7 @@ import IOperation from './contracts/IOperation'; import DBSQLOperation from './DBSQLOperation'; import Status from './dto/Status'; import InfoValue from './dto/InfoValue'; -import { definedOrError, LZ4 } from './utils'; +import { definedOrError, LZ4, ProtocolVersion } from './utils'; import CloseableCollection from './utils/CloseableCollection'; import { LogLevel } from './contracts/IDBSQLLogger'; import HiveDriverError from './errors/HiveDriverError'; @@ -74,13 +76,16 @@ function getDirectResultsOptions(maxRows: number | bigint | Int64 | null | undef }; } -function getArrowOptions(config: ClientConfig): { +function getArrowOptions( + config: ClientConfig, + serverProtocolVersion: TProtocolVersion | undefined | null, +): { canReadArrowResult: boolean; useArrowNativeTypes?: TSparkArrowTypes; } { const { arrowEnabled = true, useArrowNativeTypes = true } = config; - if (!arrowEnabled) { + if (!arrowEnabled || !ProtocolVersion.supportsArrowMetadata(serverProtocolVersion)) { return { canReadArrowResult: false, }; @@ -136,6 +141,7 @@ function getQueryParameters( interface DBSQLSessionConstructorOptions { handle: TSessionHandle; context: IClientContext; + serverProtocolVersion?: TProtocolVersion; } export default class DBSQLSession implements IDBSQLSession { @@ -145,14 +151,28 @@ export default class DBSQLSession implements IDBSQLSession { private isOpen = true; + private serverProtocolVersion?: TProtocolVersion; + public onClose?: () => void; private operations = new CloseableCollection(); - constructor({ handle, context }: DBSQLSessionConstructorOptions) { + /** + * Helper method to determine if runAsync should be set for metadata operations + * @private + * @returns true if supported by protocol version, undefined otherwise + */ + private getRunAsyncForMetadataOperations(): boolean | undefined { + return ProtocolVersion.supportsAsyncMetadataOperations(this.serverProtocolVersion) ? true : undefined; + } + + constructor({ handle, context, serverProtocolVersion }: DBSQLSessionConstructorOptions) { this.sessionHandle = handle; this.context = context; + // Get the server protocol version from the provided parameter (from TOpenSessionResp) + this.serverProtocolVersion = serverProtocolVersion; this.context.getLogger().log(LogLevel.debug, `Session created with id: ${this.id}`); + this.context.getLogger().log(LogLevel.debug, `Server protocol version: ${this.serverProtocolVersion}`); } public get id() { @@ -193,17 +213,29 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); - const operationPromise = driver.executeStatement({ + + const request = new TExecuteStatementReq({ sessionHandle: this.sessionHandle, statement, queryTimeout: options.queryTimeout ? numberToInt64(options.queryTimeout) : undefined, runAsync: true, ...getDirectResultsOptions(options.maxRows, clientConfig), - ...getArrowOptions(clientConfig), - canDownloadResult: options.useCloudFetch ?? clientConfig.useCloudFetch, - parameters: getQueryParameters(options.namedParameters, options.ordinalParameters), - canDecompressLZ4Result: clientConfig.useLZ4Compression && Boolean(LZ4), + ...getArrowOptions(clientConfig, this.serverProtocolVersion), }); + + if (ProtocolVersion.supportsParameterizedQueries(this.serverProtocolVersion)) { + request.parameters = getQueryParameters(options.namedParameters, options.ordinalParameters); + } + + if (ProtocolVersion.supportsCloudFetch(this.serverProtocolVersion)) { + request.canDownloadResult = options.useCloudFetch ?? clientConfig.useCloudFetch; + } + + if (ProtocolVersion.supportsArrowCompression(this.serverProtocolVersion) && request.canDownloadResult !== true) { + request.canDecompressLZ4Result = (options.useLZ4Compression ?? clientConfig.useLZ4Compression) && Boolean(LZ4); + } + + const operationPromise = driver.executeStatement(request); const response = await this.handleResponse(operationPromise); const operation = this.createOperation(response); @@ -352,9 +384,10 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getTypeInfo({ sessionHandle: this.sessionHandle, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -371,9 +404,10 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getCatalogs({ sessionHandle: this.sessionHandle, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -390,11 +424,12 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getSchemas({ sessionHandle: this.sessionHandle, catalogName: request.catalogName, schemaName: request.schemaName, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -411,13 +446,14 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getTables({ sessionHandle: this.sessionHandle, catalogName: request.catalogName, schemaName: request.schemaName, tableName: request.tableName, tableTypes: request.tableTypes, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -434,9 +470,10 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getTableTypes({ sessionHandle: this.sessionHandle, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -453,13 +490,14 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getColumns({ sessionHandle: this.sessionHandle, catalogName: request.catalogName, schemaName: request.schemaName, tableName: request.tableName, columnName: request.columnName, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -476,12 +514,13 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getFunctions({ sessionHandle: this.sessionHandle, catalogName: request.catalogName, schemaName: request.schemaName, functionName: request.functionName, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -492,12 +531,13 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getPrimaryKeys({ sessionHandle: this.sessionHandle, catalogName: request.catalogName, schemaName: request.schemaName, tableName: request.tableName, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); @@ -514,6 +554,7 @@ export default class DBSQLSession implements IDBSQLSession { await this.failIfClosed(); const driver = await this.context.getDriver(); const clientConfig = this.context.getConfig(); + const operationPromise = driver.getCrossReference({ sessionHandle: this.sessionHandle, parentCatalogName: request.parentCatalogName, @@ -522,7 +563,7 @@ export default class DBSQLSession implements IDBSQLSession { foreignCatalogName: request.foreignCatalogName, foreignSchemaName: request.foreignSchemaName, foreignTableName: request.foreignTableName, - runAsync: true, + runAsync: this.getRunAsyncForMetadataOperations(), ...getDirectResultsOptions(request.maxRows, clientConfig), }); const response = await this.handleResponse(operationPromise); diff --git a/lib/connection/connections/HttpConnection.ts b/lib/connection/connections/HttpConnection.ts index dc9c3902..8c56019c 100644 --- a/lib/connection/connections/HttpConnection.ts +++ b/lib/connection/connections/HttpConnection.ts @@ -98,7 +98,9 @@ export default class HttpConnection implements IConnectionProvider { this.connection = new ThriftHttpConnection( { - url: `${options.https ? 'https' : 'http'}://${options.host}:${options.port}${options.path ?? '/'}`, + url: `${options.https ? 'https' : 'http'}://${options.host.replace(/\/$/, '')}:${options.port}${ + options.path ? (options.path.startsWith('/') ? '' : '/') + options.path.replace(/\/$/, '') : '/' + }`, transport: thrift.TBufferedTransport, protocol: thrift.TBinaryProtocol, getRetryPolicy: () => this.getRetryPolicy(), diff --git a/lib/contracts/IDBSQLSession.ts b/lib/contracts/IDBSQLSession.ts index 8a0d8bf0..0f751714 100644 --- a/lib/contracts/IDBSQLSession.ts +++ b/lib/contracts/IDBSQLSession.ts @@ -17,6 +17,7 @@ export type ExecuteStatementOptions = { runAsync?: boolean; maxRows?: number | bigint | Int64 | null; useCloudFetch?: boolean; + useLZ4Compression?: boolean; stagingAllowedLocalPath?: string | string[]; namedParameters?: Record; ordinalParameters?: Array; diff --git a/lib/utils/index.ts b/lib/utils/index.ts index 963f6b05..b8203c4d 100644 --- a/lib/utils/index.ts +++ b/lib/utils/index.ts @@ -2,5 +2,6 @@ import definedOrError from './definedOrError'; import buildUserAgentString from './buildUserAgentString'; import formatProgress, { ProgressUpdateTransformer } from './formatProgress'; import LZ4 from './lz4'; +import * as ProtocolVersion from './protocolVersion'; -export { definedOrError, buildUserAgentString, formatProgress, ProgressUpdateTransformer, LZ4 }; +export { definedOrError, buildUserAgentString, formatProgress, ProgressUpdateTransformer, LZ4, ProtocolVersion }; diff --git a/lib/utils/lz4.ts b/lib/utils/lz4.ts index 8186024d..b8a8e8ad 100644 --- a/lib/utils/lz4.ts +++ b/lib/utils/lz4.ts @@ -6,10 +6,24 @@ function tryLoadLZ4Module(): LZ4Module | undefined { try { return require('lz4'); // eslint-disable-line global-require } catch (err) { - const isModuleNotFoundError = err instanceof Error && 'code' in err && err.code === 'MODULE_NOT_FOUND'; - if (!isModuleNotFoundError) { - throw err; + if (!(err instanceof Error) || !('code' in err)) { + console.warn('Unexpected error loading LZ4 module: Invalid error object', err); + return undefined; } + + if (err.code === 'MODULE_NOT_FOUND') { + console.warn('LZ4 module not installed: Missing dependency', err); + return undefined; + } + + if (err.code === 'ERR_DLOPEN_FAILED') { + console.warn('LZ4 native module failed to load: Architecture or version mismatch', err); + return undefined; + } + + // If it's not a known error, return undefined + console.warn('Unknown error loading LZ4 module: Unhandled error code', err); + return undefined; } } diff --git a/lib/utils/protocolVersion.ts b/lib/utils/protocolVersion.ts new file mode 100644 index 00000000..171cfa1a --- /dev/null +++ b/lib/utils/protocolVersion.ts @@ -0,0 +1,95 @@ +import { TProtocolVersion } from '../../thrift/TCLIService_types'; + +/** + * Protocol version information from Thrift TCLIService + * Each version adds certain features to the Spark/Hive API + * + * Databricks only supports SPARK_CLI_SERVICE_PROTOCOL_V1 (0xA501) or higher + */ + +/** + * Check if the current protocol version supports a specific feature + * @param serverProtocolVersion The protocol version received from server in TOpenSessionResp + * @param requiredVersion The minimum protocol version required for a feature + * @returns boolean indicating if the feature is supported + */ +export function isFeatureSupported( + serverProtocolVersion: TProtocolVersion | undefined | null, + requiredVersion: TProtocolVersion, +): boolean { + if (serverProtocolVersion === undefined || serverProtocolVersion === null) { + return false; + } + + return serverProtocolVersion >= requiredVersion; +} + +/** + * Check if parameterized queries are supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V8 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if parameterized queries are supported + */ +export function supportsParameterizedQueries(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8); +} + +/** + * Check if async metadata operations are supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V6 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if async metadata operations are supported + */ +export function supportsAsyncMetadataOperations(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6); +} + +/** + * Check if result persistence mode is supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V7 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if result persistence mode is supported + */ +export function supportsResultPersistenceMode(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7); +} + +/** + * Check if Arrow compression is supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V6 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if compressed Arrow batches are supported + */ +export function supportsArrowCompression(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6); +} + +/** + * Check if Arrow metadata is supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V5 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if Arrow metadata is supported + */ +export function supportsArrowMetadata(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5); +} + +/** + * Check if multiple catalogs are supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V4 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if multiple catalogs are supported + */ +export function supportsMultipleCatalogs(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V4); +} + +/** + * Check if cloud object storage fetching is supported + * (Requires SPARK_CLI_SERVICE_PROTOCOL_V3 or higher) + * @param serverProtocolVersion The protocol version from server + * @returns boolean indicating if cloud fetching is supported + */ +export function supportsCloudFetch(serverProtocolVersion: TProtocolVersion | undefined | null): boolean { + return isFeatureSupported(serverProtocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3); +} diff --git a/package-lock.json b/package-lock.json index ad6c2729..92db06ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@databricks/sql", - "version": "1.10.0", + "version": "1.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@databricks/sql", - "version": "1.10.0", + "version": "1.11.0", "license": "Apache 2.0", "dependencies": { "apache-arrow": "^13.0.0", diff --git a/package.json b/package.json index 25b875dd..7c0f75b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@databricks/sql", - "version": "1.10.0", + "version": "1.11.0", "description": "Driver for connection to Databricks SQL via Thrift API.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/tests/e2e/arrow.test.ts b/tests/e2e/arrow.test.ts index 12d87e27..9202ea9c 100644 --- a/tests/e2e/arrow.test.ts +++ b/tests/e2e/arrow.test.ts @@ -187,7 +187,10 @@ describe('Arrow support', () => { 'should handle LZ4 compressed data', createTest( async (session) => { - const operation = await session.executeStatement(`SELECT * FROM ${tableName}`); + const operation = await session.executeStatement( + `SELECT * FROM ${tableName}`, + { useCloudFetch: false }, // Explicitly disable cloud fetch to test LZ4 compression + ); const result = await operation.fetchAll(); expect(fixArrowResult(result)).to.deep.equal(expectedArrow); diff --git a/tests/e2e/cloudfetch.test.ts b/tests/e2e/cloudfetch.test.ts index 5ac46296..ae75e4be 100644 --- a/tests/e2e/cloudfetch.test.ts +++ b/tests/e2e/cloudfetch.test.ts @@ -97,11 +97,11 @@ describe('CloudFetch', () => { expect(fetchedRowCount).to.be.equal(queriedRowsCount); }); - it('should handle LZ4 compressed data', async () => { + it('should not use LZ4 compression with cloud fetch', async () => { const cloudFetchConcurrentDownloads = 5; const session = await openSession({ cloudFetchConcurrentDownloads, - useLZ4Compression: true, + useLZ4Compression: true, // This is ignored when cloud fetch is enabled }); const queriedRowsCount = 10000000; // result has to be quite big to enable CloudFetch @@ -126,7 +126,8 @@ describe('CloudFetch', () => { expect(resultHandler).to.be.instanceof(ResultSlicer); expect(resultHandler.source).to.be.instanceof(ArrowResultConverter); expect(resultHandler.source.source).to.be.instanceOf(CloudFetchResultHandler); - expect(resultHandler.source.source.isLZ4Compressed).to.be.true; + // LZ4 compression should not be enabled with cloud fetch + expect(resultHandler.source.source.isLZ4Compressed).to.be.false; const chunk = await operation.fetchChunk({ maxRows: 100000, disableBuffering: true }); expect(chunk.length).to.be.gt(0); diff --git a/tests/e2e/protocol_versions.test.ts b/tests/e2e/protocol_versions.test.ts new file mode 100644 index 00000000..d89fb04e --- /dev/null +++ b/tests/e2e/protocol_versions.test.ts @@ -0,0 +1,363 @@ +/* eslint-disable func-style, no-loop-func */ +import { expect } from 'chai'; +import sinon from 'sinon'; +import Int64 from 'node-int64'; +import { DBSQLClient } from '../../lib'; +import IDBSQLSession from '../../lib/contracts/IDBSQLSession'; +import { TProtocolVersion } from '../../thrift/TCLIService_types'; +import config from './utils/config'; +import IDriver from '../../lib/contracts/IDriver'; + +// Create a list of all SPARK protocol versions +const protocolVersions = [ + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V1, desc: 'V1: no special features' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V2, desc: 'V2: no special features' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3, desc: 'V3: cloud fetch' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V4, desc: 'V4: multiple catalogs' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5, desc: 'V5: arrow metadata' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, desc: 'V6: async metadata, arrow compression' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7, desc: 'V7: result persistence mode' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8, desc: 'V8: parameterized queries' }, +]; + +/** + * Execute a statement and return results + */ +async function execute(session: IDBSQLSession, statement: string) { + const operation = await session.executeStatement(statement); + const result = await operation.fetchAll(); + await operation.close(); + return result; +} + +describe('Protocol Versions E2E Tests', function () { + // These tests might take longer than the default timeout + this.timeout(60000); + + // Instead of using a loop with functions inside, we'll create a function that returns + // a test suite for each protocol version + protocolVersions.forEach(({ version, desc }) => { + describe(`Protocol ${desc}`, () => { + let client: DBSQLClient; + let session: IDBSQLSession; + + before(function (this: Mocha.Context) { + return (async () => { + try { + client = new DBSQLClient(); + + // Connect to the Databricks SQL service + await client.connect({ + host: config.host, + path: config.path, + token: config.token, + }); + + // Get access to the driver + const getDriverOriginal = client.getDriver.bind(client); + + // Stub getDriver to return a proxied version of the driver with overridden openSession + sinon.stub(client, 'getDriver').callsFake(async () => { + const driver = await getDriverOriginal(); + + // Create a proxy for the driver to intercept openSession calls + const driverProxy = new Proxy(driver, { + get(target, prop) { + if (prop === 'openSession') { + return async (request: any) => { + // Modify the request to use our specific protocol version + const modifiedRequest = { + ...request, + client_protocol_i64: new Int64(version), + }; + return target.openSession(modifiedRequest); + }; + } + return target[prop as keyof IDriver]; + }, + }); + + return driverProxy; + }); + + session = await client.openSession({ + initialCatalog: config.catalog, + initialSchema: config.schema, + }); + } catch (error) { + // eslint-disable-next-line no-console + console.log(`Failed to open session with protocol version ${desc}: ${error}`); + this.skip(); + } + })(); + }); + + after(async () => { + if (session) { + await session.close(); + } + if (client) { + await client.close(); + } + // Restore sinon stubs + sinon.restore(); + }); + + it('should handle various data types', async () => { + // Query testing multiple data types supported by Databricks + const query = ` + SELECT + -- Numeric types + CAST(42 AS TINYINT) AS tiny_int_val, + CAST(1000 AS SMALLINT) AS small_int_val, + CAST(100000 AS INT) AS int_val, + CAST(123456789012345 AS BIGINT) AS bigint_val, -- Using a smaller BIGINT value within JavaScript safe range + CAST(3.14 AS FLOAT) AS float_val, + CAST(3.14159265359 AS DOUBLE) AS double_val, + CAST(123.45 AS DECIMAL(5,2)) AS decimal_val, + + -- String and Binary types + CAST('hello world' AS STRING) AS string_val, + CAST(X'68656C6C6F' AS BINARY) AS binary_val, -- 'hello' in hex + + -- Boolean type + CAST(TRUE AS BOOLEAN) AS boolean_val, + + -- Date and Time types - Use current_date() to ensure consistency with server time zone + current_date() AS date_val, + current_timestamp() AS timestamp_val, + + -- Intervals + INTERVAL '1' DAY AS interval_day, + + -- Complex types + ARRAY(1, 2, 3) AS array_val, + MAP('a', 1, 'b', 2, 'c', 3) AS map_val, + STRUCT(42 AS id, 'test_name' AS name, TRUE AS active) AS struct_val, + + -- Null value + CAST(NULL AS STRING) AS null_val + `; + + const result = await execute(session, query); + expect(result).to.be.an('array'); + expect(result.length).to.equal(1); + + const row = result[0] as any; + + // Test numeric types + expect(row).to.have.property('tiny_int_val'); + expect(row.tiny_int_val).to.equal(42); + + expect(row).to.have.property('small_int_val'); + expect(row.small_int_val).to.equal(1000); + + expect(row).to.have.property('int_val'); + expect(row.int_val).to.equal(100000); + + expect(row).to.have.property('bigint_val'); + // Using a smaller bigint value that can be safely represented in JavaScript + expect(Number(row.bigint_val)).to.equal(123456789012345); + + expect(row).to.have.property('float_val'); + expect(row.float_val).to.be.closeTo(3.14, 0.001); // Allow small precision differences + + expect(row).to.have.property('double_val'); + expect(row.double_val).to.be.closeTo(3.14159265359, 0.00000000001); + + expect(row).to.have.property('decimal_val'); + expect(parseFloat(row.decimal_val)).to.be.closeTo(123.45, 0.001); + + // Test string and binary types + expect(row).to.have.property('string_val'); + expect(row.string_val).to.equal('hello world'); + + expect(row).to.have.property('binary_val'); + // Binary might be returned in different formats depending on protocol version + + // Test boolean type + expect(row).to.have.property('boolean_val'); + expect(row.boolean_val).to.be.true; + + // Test date type + expect(row).to.have.property('date_val'); + // Date may be returned as a Date object, string, or other format depending on protocol version + const dateVal = row.date_val; + + if (dateVal instanceof Date) { + // If it's a Date object, just verify it's a valid date in approximately the right range + expect(dateVal.getFullYear()).to.be.at.least(2023); + expect(dateVal).to.be.an.instanceof(Date); + } else if (typeof dateVal === 'string') { + // If it's a string, verify it contains a date-like format + expect(/\d{4}[-/]\d{1,2}[-/]\d{1,2}/.test(dateVal) || /\d{1,2}[-/]\d{1,2}[-/]\d{4}/.test(dateVal)).to.be.true; + } else { + // Otherwise just make sure it exists + expect(dateVal).to.exist; + } + + // Test timestamp type + expect(row).to.have.property('timestamp_val'); + const timestampVal = row.timestamp_val; + + if (timestampVal instanceof Date) { + // If it's a Date object, verify it's a valid date-time + expect(timestampVal.getFullYear()).to.be.at.least(2023); + expect(timestampVal).to.be.an.instanceof(Date); + } else if (typeof timestampVal === 'string') { + // If it's a string, verify it contains date and time components + expect(/\d{4}[-/]\d{1,2}[-/]\d{1,2}/.test(timestampVal)).to.be.true; // has date part + expect(/\d{1,2}:\d{1,2}(:\d{1,2})?/.test(timestampVal)).to.be.true; // has time part + } else { + // Otherwise just make sure it exists + expect(timestampVal).to.exist; + } + + // Test interval + expect(row).to.have.property('interval_day'); + + // Test array type + expect(row).to.have.property('array_val'); + const arrayVal = row.array_val; + + // Handle various ways arrays might be represented + if (Array.isArray(arrayVal)) { + expect(arrayVal).to.have.lengthOf(3); + expect(arrayVal).to.include.members([1, 2, 3]); + } else if (typeof arrayVal === 'string') { + // Sometimes arrays might be returned as strings like "[1,2,3]" + expect(arrayVal).to.include('1'); + expect(arrayVal).to.include('2'); + expect(arrayVal).to.include('3'); + } else { + // For other formats, just check it exists + expect(arrayVal).to.exist; + } + + // Test map type + expect(row).to.have.property('map_val'); + const mapVal = row.map_val; + + // Maps could be returned in several formats depending on the protocol version + if (typeof mapVal === 'object' && mapVal !== null && !Array.isArray(mapVal)) { + // If returned as a plain JavaScript object + expect(mapVal).to.have.property('a', 1); + expect(mapVal).to.have.property('b', 2); + expect(mapVal).to.have.property('c', 3); + } else if (typeof mapVal === 'string') { + // Sometimes might be serialized as string + expect(mapVal).to.include('a'); + expect(mapVal).to.include('b'); + expect(mapVal).to.include('c'); + expect(mapVal).to.include('1'); + expect(mapVal).to.include('2'); + expect(mapVal).to.include('3'); + } else { + // For other formats, just check it exists + expect(mapVal).to.exist; + } + + // Test struct type + expect(row).to.have.property('struct_val'); + const structVal = row.struct_val; + + // Structs could be represented differently based on protocol version + if (typeof structVal === 'object' && structVal !== null && !Array.isArray(structVal)) { + // If returned as a plain JavaScript object + expect(structVal).to.have.property('id', 42); + expect(structVal).to.have.property('name', 'test_name'); + expect(structVal).to.have.property('active', true); + } else if (typeof structVal === 'string') { + // If serialized as string + expect(structVal).to.include('42'); + expect(structVal).to.include('test_name'); + } else { + // For other formats, just check it exists + expect(structVal).to.exist; + } + + // Test null value + expect(row).to.have.property('null_val'); + expect(row.null_val).to.be.null; + }); + + it('should get catalogs', async () => { + const operation = await session.getCatalogs(); + const catalogs = await operation.fetchAll(); + await operation.close(); + + expect(catalogs).to.be.an('array'); + expect(catalogs.length).to.be.at.least(1); + expect(catalogs[0]).to.have.property('TABLE_CAT'); + }); + + it('should get schemas', async () => { + const operation = await session.getSchemas({ catalogName: config.catalog }); + const schemas = await operation.fetchAll(); + await operation.close(); + + expect(schemas).to.be.an('array'); + expect(schemas.length).to.be.at.least(1); + expect(schemas[0]).to.have.property('TABLE_SCHEM'); + }); + + it('should get table types', async () => { + const operation = await session.getTableTypes(); + const tableTypes = await operation.fetchAll(); + await operation.close(); + + expect(tableTypes).to.be.an('array'); + expect(tableTypes.length).to.be.at.least(1); + expect(tableTypes[0]).to.have.property('TABLE_TYPE'); + }); + + it('should get tables', async () => { + const operation = await session.getTables({ + catalogName: config.catalog, + schemaName: config.schema, + }); + const tables = await operation.fetchAll(); + await operation.close(); + + expect(tables).to.be.an('array'); + // There might not be any tables, so we don't assert on the length + if (tables.length > 0) { + expect(tables[0]).to.have.property('TABLE_NAME'); + } + }); + + it('should get columns from current schema', function (this: Mocha.Context) { + return (async () => { + // First get a table name from the current schema + const tablesOp = await session.getTables({ + catalogName: config.catalog, + schemaName: config.schema, + }); + const tables = await tablesOp.fetchAll(); + await tablesOp.close(); + + if (tables.length === 0) { + // eslint-disable-next-line no-console + console.log('No tables found in the schema, skipping column test'); + this.skip(); + return; + } + + const tableName = (tables[0] as any).TABLE_NAME; + + const operation = await session.getColumns({ + catalogName: config.catalog, + schemaName: config.schema, + tableName, + }); + const columns = await operation.fetchAll(); + await operation.close(); + + expect(columns).to.be.an('array'); + expect(columns.length).to.be.at.least(1); + expect(columns[0]).to.have.property('COLUMN_NAME'); + })(); + }); + }); + }); +}); diff --git a/tests/unit/DBSQLClient.test.ts b/tests/unit/DBSQLClient.test.ts index f4ac593f..f942c6b8 100644 --- a/tests/unit/DBSQLClient.test.ts +++ b/tests/unit/DBSQLClient.test.ts @@ -16,6 +16,7 @@ import IThriftClient from '../../lib/contracts/IThriftClient'; import IAuthentication from '../../lib/connection/contracts/IAuthentication'; import AuthProviderStub from './.stubs/AuthProviderStub'; import ConnectionProviderStub from './.stubs/ConnectionProviderStub'; +import { TProtocolVersion } from '../../thrift/TCLIService_types'; const connectOptions = { host: '127.0.0.1', @@ -155,6 +156,84 @@ describe('DBSQLClient.openSession', () => { expect(error.message).to.be.eq('DBSQLClient: not connected'); } }); + + it('should correctly pass server protocol version to session', async () => { + const client = new DBSQLClient(); + const thriftClient = new ThriftClientStub(); + sinon.stub(client, 'getClient').returns(Promise.resolve(thriftClient)); + + // Test with default protocol version (SPARK_CLI_SERVICE_PROTOCOL_V8) + { + const session = await client.openSession(); + expect(session).instanceOf(DBSQLSession); + expect((session as DBSQLSession)['serverProtocolVersion']).to.equal( + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8, + ); + } + + { + thriftClient.openSessionResp = { + ...thriftClient.openSessionResp, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7, + }; + + const session = await client.openSession(); + expect(session).instanceOf(DBSQLSession); + expect((session as DBSQLSession)['serverProtocolVersion']).to.equal( + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7, + ); + } + }); + + it('should affect session behavior based on protocol version', async () => { + const client = new DBSQLClient(); + const thriftClient = new ThriftClientStub(); + sinon.stub(client, 'getClient').returns(Promise.resolve(thriftClient)); + + // With protocol version V6 - should support async metadata operations + { + thriftClient.openSessionResp = { + ...thriftClient.openSessionResp, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, + }; + + const session = await client.openSession(); + expect(session).instanceOf(DBSQLSession); + + // Spy on driver.getTypeInfo to check if runAsync is set + const driver = await client.getDriver(); + const getTypeInfoSpy = sinon.spy(driver, 'getTypeInfo'); + + await session.getTypeInfo(); + + expect(getTypeInfoSpy.calledOnce).to.be.true; + expect(getTypeInfoSpy.firstCall.args[0].runAsync).to.be.true; + + getTypeInfoSpy.restore(); + } + + // With protocol version V5 - should NOT support async metadata operations + { + thriftClient.openSessionResp = { + ...thriftClient.openSessionResp, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5, + }; + + const session = await client.openSession(); + expect(session).instanceOf(DBSQLSession); + + // Spy on driver.getTypeInfo to check if runAsync is undefined + const driver = await client.getDriver(); + const getTypeInfoSpy = sinon.spy(driver, 'getTypeInfo'); + + await session.getTypeInfo(); + + expect(getTypeInfoSpy.calledOnce).to.be.true; + expect(getTypeInfoSpy.firstCall.args[0].runAsync).to.be.undefined; + + getTypeInfoSpy.restore(); + } + }); }); describe('DBSQLClient.getClient', () => { diff --git a/tests/unit/DBSQLSession.test.ts b/tests/unit/DBSQLSession.test.ts index 460047f5..ddf843dc 100644 --- a/tests/unit/DBSQLSession.test.ts +++ b/tests/unit/DBSQLSession.test.ts @@ -5,7 +5,7 @@ import DBSQLSession, { numberToInt64 } from '../../lib/DBSQLSession'; import InfoValue from '../../lib/dto/InfoValue'; import Status from '../../lib/dto/Status'; import DBSQLOperation from '../../lib/DBSQLOperation'; -import { TSessionHandle } from '../../thrift/TCLIService_types'; +import { TSessionHandle, TProtocolVersion } from '../../thrift/TCLIService_types'; import ClientContextStub from './.stubs/ClientContextStub'; const sessionHandleStub: TSessionHandle = { @@ -86,7 +86,8 @@ describe('DBSQLSession', () => { }); it('should apply defaults for Arrow options', async () => { - case1: { + // case 1 + { const session = new DBSQLSession({ handle: sessionHandleStub, context: new ClientContextStub({ arrowEnabled: true }), @@ -95,7 +96,8 @@ describe('DBSQLSession', () => { expect(result).instanceOf(DBSQLOperation); } - case2: { + // case 2 + { const session = new DBSQLSession({ handle: sessionHandleStub, context: new ClientContextStub({ arrowEnabled: true, useArrowNativeTypes: false }), @@ -105,6 +107,156 @@ describe('DBSQLSession', () => { } }); }); + + describe('executeStatement with different protocol versions', () => { + const protocolVersions = [ + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V1, desc: 'V1: no special features' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V2, desc: 'V2: no special features' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3, desc: 'V3: cloud fetch' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V4, desc: 'V4: multiple catalogs' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5, desc: 'V5: arrow metadata' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, desc: 'V6: async metadata, arrow compression' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7, desc: 'V7: result persistence mode' }, + { version: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8, desc: 'V8: parameterized queries' }, + ]; + + for (const { version, desc } of protocolVersions) { + it(`should properly format request with protocol version ${desc}`, async () => { + const context = new ClientContextStub(); + const driver = sinon.spy(context.driver); + const statement = 'SELECT * FROM table'; + const options = { + maxRows: 10, + queryTimeout: 100, + namedParameters: { param1: 'value1' }, + useCloudFetch: true, + useLZ4Compression: true, + }; + + const session = new DBSQLSession({ + handle: sessionHandleStub, + context, + serverProtocolVersion: version, + }); + + await session.executeStatement(statement, options); + + expect(driver.executeStatement.callCount).to.eq(1); + const req = driver.executeStatement.firstCall.args[0]; + + // Basic fields that should always be present + expect(req.sessionHandle.sessionId.guid).to.deep.equal(sessionHandleStub.sessionId.guid); + expect(req.sessionHandle.sessionId.secret).to.deep.equal(sessionHandleStub.sessionId.secret); + expect(req.statement).to.equal(statement); + expect(req.runAsync).to.be.true; + expect(req.queryTimeout).to.deep.equal(numberToInt64(options.queryTimeout)); + + // Fields that depend on protocol version + if (version >= TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8) { + expect(req.parameters).to.exist; + expect(req.parameters?.length).to.equal(1); + } else { + expect(req.parameters).to.not.exist; + } + + if (version >= TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6) { + // Since cloud fetch is enabled, canDecompressLZ4Result should not be set + if (req.canDownloadResult === true) { + expect(req.canDecompressLZ4Result).to.not.be.true; + } else { + expect(req.canDecompressLZ4Result).to.be.true; + } + } else { + expect(req.canDecompressLZ4Result).to.not.be.true; + } + + if (version >= TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5) { + expect(req.canReadArrowResult).to.be.true; + expect(req.useArrowNativeTypes).to.not.be.undefined; + } else if (version >= TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3) { + // V3 and V4 have canDownloadResult but not arrow-related fields + expect(req.canReadArrowResult).to.be.false; + expect(req.useArrowNativeTypes).to.not.exist; + expect(req.canDownloadResult).to.be.true; + } else { + // V1 and V2 don't have arrow or download features + expect(req.canReadArrowResult).to.be.false; + expect(req.useArrowNativeTypes).to.not.exist; + expect(req.canDownloadResult).to.not.exist; + } + }); + } + }); + + describe('LZ4 compression with cloud fetch', () => { + it('should not set canDecompressLZ4Result when cloud fetch is enabled (canDownloadResult=true)', async () => { + const context = new ClientContextStub({ useLZ4Compression: true }); + const driver = sinon.spy(context.driver); + const statement = 'SELECT * FROM table'; + + // Use V6+ which supports arrow compression + const session = new DBSQLSession({ + handle: sessionHandleStub, + context, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, + }); + + // Execute with cloud fetch enabled + await session.executeStatement(statement, { useCloudFetch: true }); + + expect(driver.executeStatement.callCount).to.eq(1); + const req = driver.executeStatement.firstCall.args[0]; + + // canDownloadResult should be true and canDecompressLZ4Result should NOT be set + expect(req.canDownloadResult).to.be.true; + expect(req.canDecompressLZ4Result).to.not.be.true; + }); + + it('should set canDecompressLZ4Result when cloud fetch is disabled (canDownloadResult=false)', async () => { + const context = new ClientContextStub({ useLZ4Compression: true }); + const driver = sinon.spy(context.driver); + const statement = 'SELECT * FROM table'; + + // Use V6+ which supports arrow compression + const session = new DBSQLSession({ + handle: sessionHandleStub, + context, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, + }); + + // Execute with cloud fetch disabled + await session.executeStatement(statement, { useCloudFetch: false }); + + expect(driver.executeStatement.callCount).to.eq(1); + const req = driver.executeStatement.firstCall.args[0]; + + // canDownloadResult should be false and canDecompressLZ4Result should be set + expect(req.canDownloadResult).to.be.false; + expect(req.canDecompressLZ4Result).to.be.true; + }); + + it('should not set canDecompressLZ4Result when server protocol does not support Arrow compression', async () => { + const context = new ClientContextStub({ useLZ4Compression: true }); + const driver = sinon.spy(context.driver); + const statement = 'SELECT * FROM table'; + + // Use V5 which does not support arrow compression + const session = new DBSQLSession({ + handle: sessionHandleStub, + context, + serverProtocolVersion: TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5, + }); + + // Execute with cloud fetch disabled + await session.executeStatement(statement, { useCloudFetch: false }); + + expect(driver.executeStatement.callCount).to.eq(1); + const req = driver.executeStatement.firstCall.args[0]; + + // canDecompressLZ4Result should NOT be set regardless of cloud fetch setting + expect(req.canDecompressLZ4Result).to.not.be.true; + }); + }); }); describe('getTypeInfo', () => { diff --git a/tests/unit/connection/connections/HttpConnection.test.ts b/tests/unit/connection/connections/HttpConnection.test.ts index c7b39972..44d38a69 100644 --- a/tests/unit/connection/connections/HttpConnection.test.ts +++ b/tests/unit/connection/connections/HttpConnection.test.ts @@ -2,7 +2,7 @@ import http from 'http'; import { expect } from 'chai'; import HttpConnection from '../../../../lib/connection/connections/HttpConnection'; import ThriftHttpConnection from '../../../../lib/connection/connections/ThriftHttpConnection'; - +import IConnectionOptions from '../../../../lib/connection/contracts/IConnectionOptions'; import ClientContextStub from '../../.stubs/ClientContextStub'; describe('HttpConnection.connect', () => { @@ -127,4 +127,54 @@ describe('HttpConnection.connect', () => { ...extraHeaders, }); }); + + it('should handle trailing slashes in host correctly', async () => { + interface TestCase { + input: { + host: string; + path?: string; + }; + expected: string; + } + + const testCases: TestCase[] = [ + { + input: { host: 'xyz.com/', path: '/sql/v1' }, + expected: 'https://xyz.com:443/sql/v1', + }, + { + input: { host: 'xyz.com', path: '/sql/v1' }, + expected: 'https://xyz.com:443/sql/v1', + }, + { + input: { host: 'xyz.com/', path: undefined }, + expected: 'https://xyz.com:443/', + }, + { + input: { host: 'xyz.com', path: 'sql/v1' }, + expected: 'https://xyz.com:443/sql/v1', + }, + { + input: { host: 'xyz.com/', path: 'sql/v1' }, + expected: 'https://xyz.com:443/sql/v1', + }, + { + input: { host: 'xyz.com', path: 'sql/v1/' }, + expected: 'https://xyz.com:443/sql/v1', + }, + ]; + + for (const testCase of testCases) { + const options: IConnectionOptions = { + host: testCase.input.host, + port: 443, + path: testCase.input.path, + https: true, + }; + + const connection = new HttpConnection(options, new ClientContextStub()); + const thriftConnection = await connection.getThriftConnection(); + expect(thriftConnection.url).to.be.equal(testCase.expected); + } + }); }); diff --git a/tests/unit/result/ArrowResultHandler.test.ts b/tests/unit/result/ArrowResultHandler.test.ts index c657b16b..3003083f 100644 --- a/tests/unit/result/ArrowResultHandler.test.ts +++ b/tests/unit/result/ArrowResultHandler.test.ts @@ -229,4 +229,17 @@ describe('ArrowResultHandler', () => { }); expect(await result.hasMore()).to.be.false; }); + + it('should handle data without LZ4 compression', async () => { + const rowSetProvider = new ResultsProviderStub([sampleRowSet1], undefined); + const result = new ArrowResultHandler(new ClientContextStub(), rowSetProvider, { + status: { statusCode: TStatusCode.SUCCESS_STATUS }, + arrowSchema: sampleArrowSchema, + lz4Compressed: false, + }); + + const { batches } = await result.fetchNext({ limit: 10000 }); + const expectedBatches = sampleRowSet1.arrowBatches?.map(({ batch }) => batch) ?? []; // Ensure iterable + expect(batches).to.deep.eq([sampleArrowSchema, ...expectedBatches]); + }); }); diff --git a/tests/unit/result/CloudFetchResultHandler.test.ts b/tests/unit/result/CloudFetchResultHandler.test.ts index 7927ee41..77950d6a 100644 --- a/tests/unit/result/CloudFetchResultHandler.test.ts +++ b/tests/unit/result/CloudFetchResultHandler.test.ts @@ -379,4 +379,24 @@ describe('CloudFetchResultHandler', () => { expect(context.invokeWithRetryStub.callCount).to.be.equal(1); } }); + + it('should handle data without LZ4 compression', async () => { + const context = new ClientContextStub(); + const rowSetProvider = new ResultsProviderStub([sampleRowSet1], undefined); + + const result = new CloudFetchResultHandler(context, rowSetProvider, { + lz4Compressed: false, + status: { statusCode: TStatusCode.SUCCESS_STATUS }, + }); + + context.invokeWithRetryStub.callsFake(async () => ({ + request: new Request('localhost'), + response: new Response(sampleArrowBatch, { status: 200 }), // Return only the batch + })); + + const { batches } = await result.fetchNext({ limit: 10000 }); + + // Ensure the batches array matches the expected structure + expect(batches).to.deep.eq([sampleArrowBatch]); + }); }); diff --git a/tests/unit/utils/protocolVersion.test.ts b/tests/unit/utils/protocolVersion.test.ts new file mode 100644 index 00000000..3469dfe8 --- /dev/null +++ b/tests/unit/utils/protocolVersion.test.ts @@ -0,0 +1,74 @@ +import { expect } from 'chai'; +import { TProtocolVersion } from '../../../thrift/TCLIService_types'; +import * as ProtocolVersion from '../../../lib/utils/protocolVersion'; + +describe('Protocol Version Utility - Parameterized Tests', () => { + // Define minimum protocol versions for each feature + const MIN_VERSION_CLOUD_FETCH = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3; + const MIN_VERSION_MULTIPLE_CATALOGS = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V4; + const MIN_VERSION_ARROW_METADATA = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5; + const MIN_VERSION_ARROW_COMPRESSION = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6; + const MIN_VERSION_ASYNC_METADATA = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6; + const MIN_VERSION_RESULT_PERSISTENCE = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7; + const MIN_VERSION_PARAMETERIZED = TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8; + + // Create an array of all protocol versions to test against + const protocolVersions = [ + TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V1, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V2, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V3, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V4, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V6, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7, + TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8, + ]; + + // Test each protocol version against each feature function + protocolVersions.forEach((version) => { + describe(`with protocol version ${version}`, () => { + it('supportsCloudFetch', () => { + const expected = version >= MIN_VERSION_CLOUD_FETCH; + const actual = ProtocolVersion.supportsCloudFetch(version); + expect(actual).to.equal(expected); + }); + + it('supportsMultipleCatalogs', () => { + const expected = version >= MIN_VERSION_MULTIPLE_CATALOGS; + const actual = ProtocolVersion.supportsMultipleCatalogs(version); + expect(actual).to.equal(expected); + }); + + it('supportsArrowMetadata', () => { + const expected = version >= MIN_VERSION_ARROW_METADATA; + const actual = ProtocolVersion.supportsArrowMetadata(version); + expect(actual).to.equal(expected); + }); + + it('supportsArrowCompression', () => { + const expected = version >= MIN_VERSION_ARROW_COMPRESSION; + const actual = ProtocolVersion.supportsArrowCompression(version); + expect(actual).to.equal(expected); + }); + + it('supportsAsyncMetadataOperations', () => { + const expected = version >= MIN_VERSION_ASYNC_METADATA; + const actual = ProtocolVersion.supportsAsyncMetadataOperations(version); + expect(actual).to.equal(expected); + }); + + it('supportsResultPersistenceMode', () => { + const expected = version >= MIN_VERSION_RESULT_PERSISTENCE; + const actual = ProtocolVersion.supportsResultPersistenceMode(version); + expect(actual).to.equal(expected); + }); + + it('supportsParameterizedQueries', () => { + const expected = version >= MIN_VERSION_PARAMETERIZED; + const actual = ProtocolVersion.supportsParameterizedQueries(version); + expect(actual).to.equal(expected); + }); + }); + }); +}); diff --git a/thrift/TCLIService.d.ts b/thrift/TCLIService.d.ts index 5e254361..6877c049 100644 --- a/thrift/TCLIService.d.ts +++ b/thrift/TCLIService.d.ts @@ -15,19 +15,12 @@ import TTypeId = ttypes.TTypeId import TSparkRowSetType = ttypes.TSparkRowSetType import TDBSqlCompressionCodec = ttypes.TDBSqlCompressionCodec import TDBSqlArrowLayout = ttypes.TDBSqlArrowLayout -import TOperationIdempotencyType = ttypes.TOperationIdempotencyType -import TOperationTimeoutLevel = ttypes.TOperationTimeoutLevel import TStatusCode = ttypes.TStatusCode import TOperationState = ttypes.TOperationState import TOperationType = ttypes.TOperationType import TGetInfoType = ttypes.TGetInfoType -import TResultPersistenceMode = ttypes.TResultPersistenceMode -import TDBSqlCloseOperationReason = ttypes.TDBSqlCloseOperationReason import TCacheLookupResult = ttypes.TCacheLookupResult -import TCloudFetchDisabledReason = ttypes.TCloudFetchDisabledReason -import TDBSqlManifestFileFormat = ttypes.TDBSqlManifestFileFormat import TFetchOrientation = ttypes.TFetchOrientation -import TDBSqlFetchDisposition = ttypes.TDBSqlFetchDisposition import TJobExecutionStatus = ttypes.TJobExecutionStatus import PRIMITIVE_TYPES = ttypes.PRIMITIVE_TYPES import COMPLEX_TYPES = ttypes.COMPLEX_TYPES @@ -72,13 +65,7 @@ import TDBSqlArrowFormat = ttypes.TDBSqlArrowFormat import TDBSqlResultFormat = ttypes.TDBSqlResultFormat import TSparkArrowBatch = ttypes.TSparkArrowBatch import TSparkArrowResultLink = ttypes.TSparkArrowResultLink -import TDBSqlCloudResultFile = ttypes.TDBSqlCloudResultFile import TRowSet = ttypes.TRowSet -import TDBSqlTempView = ttypes.TDBSqlTempView -import TDBSqlSessionCapabilities = ttypes.TDBSqlSessionCapabilities -import TExpressionInfo = ttypes.TExpressionInfo -import TDBSqlConfValue = ttypes.TDBSqlConfValue -import TDBSqlSessionConf = ttypes.TDBSqlSessionConf import TStatus = ttypes.TStatus import TNamespace = ttypes.TNamespace import THandleIdentifier = ttypes.THandleIdentifier @@ -95,8 +82,8 @@ import TSparkGetDirectResults = ttypes.TSparkGetDirectResults import TSparkDirectResults = ttypes.TSparkDirectResults import TSparkArrowTypes = ttypes.TSparkArrowTypes import TExecuteStatementReq = ttypes.TExecuteStatementReq -import TDBSqlStatement = ttypes.TDBSqlStatement import TSparkParameterValue = ttypes.TSparkParameterValue +import TSparkParameterValueArg = ttypes.TSparkParameterValueArg import TSparkParameter = ttypes.TSparkParameter import TStatementConf = ttypes.TStatementConf import TExecuteStatementResp = ttypes.TExecuteStatementResp diff --git a/thrift/TCLIService_types.d.ts b/thrift/TCLIService_types.d.ts index fa242704..90c5986a 100644 --- a/thrift/TCLIService_types.d.ts +++ b/thrift/TCLIService_types.d.ts @@ -30,6 +30,7 @@ declare enum TProtocolVersion { SPARK_CLI_SERVICE_PROTOCOL_V6 = 42246, SPARK_CLI_SERVICE_PROTOCOL_V7 = 42247, SPARK_CLI_SERVICE_PROTOCOL_V8 = 42248, + SPARK_CLI_SERVICE_PROTOCOL_V9 = 42249, } declare enum TTypeId { @@ -75,17 +76,6 @@ declare enum TDBSqlArrowLayout { ARROW_STREAMING = 1, } -declare enum TOperationIdempotencyType { - UNKNOWN = 0, - NON_IDEMPOTENT = 1, - IDEMPOTENT = 2, -} - -declare enum TOperationTimeoutLevel { - CLUSTER = 0, - SESSION = 1, -} - declare enum TStatusCode { SUCCESS_STATUS = 0, SUCCESS_WITH_INFO_STATUS = 1, @@ -168,17 +158,6 @@ declare enum TGetInfoType { CLI_MAX_IDENTIFIER_LEN = 10005, } -declare enum TResultPersistenceMode { - ONLY_LARGE_RESULTS = 0, - ALL_QUERY_RESULTS = 1, - ALL_RESULTS = 2, -} - -declare enum TDBSqlCloseOperationReason { - NONE = 0, - COMMAND_INACTIVITY_TIMEOUT = 1, -} - declare enum TCacheLookupResult { CACHE_INELIGIBLE = 0, LOCAL_CACHE_HIT = 1, @@ -186,21 +165,6 @@ declare enum TCacheLookupResult { CACHE_MISS = 3, } -declare enum TCloudFetchDisabledReason { - ARROW_SUPPORT = 0, - CLOUD_FETCH_SUPPORT = 1, - PROTOCOL_VERSION = 2, - REGION_SUPPORT = 3, - BLOCKLISTED_OPERATION = 4, - SMALL_RESULT_SIZE = 5, - CUSTOMER_STORAGE_SUPPORT = 6, - UNKNOWN = 7, -} - -declare enum TDBSqlManifestFileFormat { - THRIFT_GET_RESULT_SET_METADATA_RESP = 0, -} - declare enum TFetchOrientation { FETCH_NEXT = 0, FETCH_PRIOR = 1, @@ -210,13 +174,6 @@ declare enum TFetchOrientation { FETCH_LAST = 5, } -declare enum TDBSqlFetchDisposition { - DISPOSITION_UNSPECIFIED = 0, - DISPOSITION_INLINE = 1, - DISPOSITION_EXTERNAL_LINKS = 2, - DISPOSITION_INTERNAL_DBFS = 3, -} - declare enum TJobExecutionStatus { IN_PROGRESS = 0, COMPLETE = 1, @@ -480,19 +437,6 @@ declare class TSparkArrowResultLink { constructor(args?: { fileLink: string; expiryTime: Int64; startRowOffset: Int64; rowCount: Int64; bytesNum: Int64; httpHeaders?: { [k: string]: string; }; }); } -declare class TDBSqlCloudResultFile { - public filePath?: string; - public startRowOffset?: Int64; - public rowCount?: Int64; - public uncompressedBytes?: Int64; - public compressedBytes?: Int64; - public fileLink?: string; - public linkExpiryTime?: Int64; - public httpHeaders?: { [k: string]: string; }; - - constructor(args?: { filePath?: string; startRowOffset?: Int64; rowCount?: Int64; uncompressedBytes?: Int64; compressedBytes?: Int64; fileLink?: string; linkExpiryTime?: Int64; httpHeaders?: { [k: string]: string; }; }); -} - declare class TRowSet { public startRowOffset: Int64; public rows: TRow[]; @@ -501,59 +445,8 @@ declare class TRowSet { public columnCount?: number; public arrowBatches?: TSparkArrowBatch[]; public resultLinks?: TSparkArrowResultLink[]; - public cloudFetchResults?: TDBSqlCloudResultFile[]; - constructor(args?: { startRowOffset: Int64; rows: TRow[]; columns?: TColumn[]; binaryColumns?: Buffer; columnCount?: number; arrowBatches?: TSparkArrowBatch[]; resultLinks?: TSparkArrowResultLink[]; cloudFetchResults?: TDBSqlCloudResultFile[]; }); -} - -declare class TDBSqlTempView { - public name?: string; - public sqlStatement?: string; - public properties?: { [k: string]: string; }; - public viewSchema?: string; - - constructor(args?: { name?: string; sqlStatement?: string; properties?: { [k: string]: string; }; viewSchema?: string; }); -} - -declare class TDBSqlSessionCapabilities { - public supportsMultipleCatalogs?: boolean; - - constructor(args?: { supportsMultipleCatalogs?: boolean; }); -} - -declare class TExpressionInfo { - public className?: string; - public usage?: string; - public name?: string; - public extended?: string; - public db?: string; - public arguments?: string; - public examples?: string; - public note?: string; - public group?: string; - public since?: string; - public deprecated?: string; - public source?: string; - - constructor(args?: { className?: string; usage?: string; name?: string; extended?: string; db?: string; arguments?: string; examples?: string; note?: string; group?: string; since?: string; deprecated?: string; source?: string; }); -} - -declare class TDBSqlConfValue { - public value?: string; - - constructor(args?: { value?: string; }); -} - -declare class TDBSqlSessionConf { - public confs?: { [k: string]: string; }; - public tempViews?: TDBSqlTempView[]; - public currentDatabase?: string; - public currentCatalog?: string; - public sessionCapabilities?: TDBSqlSessionCapabilities; - public expressionsInfos?: TExpressionInfo[]; - public internalConfs?: { [k: string]: TDBSqlConfValue; }; - - constructor(args?: { confs?: { [k: string]: string; }; tempViews?: TDBSqlTempView[]; currentDatabase?: string; currentCatalog?: string; sessionCapabilities?: TDBSqlSessionCapabilities; expressionsInfos?: TExpressionInfo[]; internalConfs?: { [k: string]: TDBSqlConfValue; }; }); + constructor(args?: { startRowOffset: Int64; rows: TRow[]; columns?: TColumn[]; binaryColumns?: Buffer; columnCount?: number; arrowBatches?: TSparkArrowBatch[]; resultLinks?: TSparkArrowResultLink[]; }); } declare class TStatus { @@ -564,9 +457,8 @@ declare class TStatus { public errorMessage?: string; public displayMessage?: string; public errorDetailsJson?: string; - public responseValidation?: Buffer; - constructor(args?: { statusCode: TStatusCode; infoMessages?: string[]; sqlState?: string; errorCode?: number; errorMessage?: string; displayMessage?: string; errorDetailsJson?: string; responseValidation?: Buffer; }); + constructor(args?: { statusCode: TStatusCode; infoMessages?: string[]; sqlState?: string; errorCode?: number; errorMessage?: string; displayMessage?: string; errorDetailsJson?: string; }); } declare class TNamespace { @@ -579,16 +471,14 @@ declare class TNamespace { declare class THandleIdentifier { public guid: Buffer; public secret: Buffer; - public executionVersion?: number; - constructor(args?: { guid: Buffer; secret: Buffer; executionVersion?: number; }); + constructor(args?: { guid: Buffer; secret: Buffer; }); } declare class TSessionHandle { public sessionId: THandleIdentifier; - public serverProtocolVersion?: TProtocolVersion; - constructor(args?: { sessionId: THandleIdentifier; serverProtocolVersion?: TProtocolVersion; }); + constructor(args?: { sessionId: THandleIdentifier; }); } declare class TOperationHandle { @@ -610,9 +500,8 @@ declare class TOpenSessionReq { public connectionProperties?: { [k: string]: string; }; public initialNamespace?: TNamespace; public canUseMultipleCatalogs?: boolean; - public sessionId?: THandleIdentifier; - constructor(args?: { client_protocol?: TProtocolVersion; username?: string; password?: string; configuration?: { [k: string]: string; }; getInfos?: TGetInfoType[]; client_protocol_i64?: Int64; connectionProperties?: { [k: string]: string; }; initialNamespace?: TNamespace; canUseMultipleCatalogs?: boolean; sessionId?: THandleIdentifier; }); + constructor(args?: { client_protocol?: TProtocolVersion; username?: string; password?: string; configuration?: { [k: string]: string; }; getInfos?: TGetInfoType[]; client_protocol_i64?: Int64; connectionProperties?: { [k: string]: string; }; initialNamespace?: TNamespace; canUseMultipleCatalogs?: boolean; }); } declare class TOpenSessionResp { @@ -653,9 +542,8 @@ declare class TGetInfoValue { declare class TGetInfoReq { public sessionHandle: TSessionHandle; public infoType: TGetInfoType; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; infoType: TGetInfoType; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; infoType: TGetInfoType; }); } declare class TGetInfoResp { @@ -707,35 +595,8 @@ declare class TExecuteStatementReq { public parameters?: TSparkParameter[]; public maxBytesPerBatch?: Int64; public statementConf?: TStatementConf; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - public rejectHighCostQueries?: boolean; - public estimatedCost?: number; - public executionVersion?: number; - public requestValidation?: Buffer; - public resultPersistenceMode?: TResultPersistenceMode; - public trimArrowBatchesToLimit?: boolean; - public fetchDisposition?: TDBSqlFetchDisposition; - public enforceResultPersistenceMode?: boolean; - public statementList?: TDBSqlStatement[]; - public persistResultManifest?: boolean; - public resultRetentionSeconds?: Int64; - public resultByteLimit?: Int64; - public resultDataFormat?: TDBSqlResultFormat; - public originatingClientIdentity?: string; - public preferSingleFileResult?: boolean; - public preferDriverOnlyUpload?: boolean; - public enforceEmbeddedSchemaCorrectness?: boolean; - public idempotencyToken?: string; - public throwErrorOnByteLimitTruncation?: boolean; - - constructor(args?: { sessionHandle: TSessionHandle; statement: string; confOverlay?: { [k: string]: string; }; runAsync?: boolean; getDirectResults?: TSparkGetDirectResults; queryTimeout?: Int64; canReadArrowResult?: boolean; canDownloadResult?: boolean; canDecompressLZ4Result?: boolean; maxBytesPerFile?: Int64; useArrowNativeTypes?: TSparkArrowTypes; resultRowLimit?: Int64; parameters?: TSparkParameter[]; maxBytesPerBatch?: Int64; statementConf?: TStatementConf; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; rejectHighCostQueries?: boolean; estimatedCost?: number; executionVersion?: number; requestValidation?: Buffer; resultPersistenceMode?: TResultPersistenceMode; trimArrowBatchesToLimit?: boolean; fetchDisposition?: TDBSqlFetchDisposition; enforceResultPersistenceMode?: boolean; statementList?: TDBSqlStatement[]; persistResultManifest?: boolean; resultRetentionSeconds?: Int64; resultByteLimit?: Int64; resultDataFormat?: TDBSqlResultFormat; originatingClientIdentity?: string; preferSingleFileResult?: boolean; preferDriverOnlyUpload?: boolean; enforceEmbeddedSchemaCorrectness?: boolean; idempotencyToken?: string; throwErrorOnByteLimitTruncation?: boolean; }); -} - -declare class TDBSqlStatement { - public statement?: string; - - constructor(args?: { statement?: string; }); + + constructor(args?: { sessionHandle: TSessionHandle; statement: string; confOverlay?: { [k: string]: string; }; runAsync?: boolean; getDirectResults?: TSparkGetDirectResults; queryTimeout?: Int64; canReadArrowResult?: boolean; canDownloadResult?: boolean; canDecompressLZ4Result?: boolean; maxBytesPerFile?: Int64; useArrowNativeTypes?: TSparkArrowTypes; resultRowLimit?: Int64; parameters?: TSparkParameter[]; maxBytesPerBatch?: Int64; statementConf?: TStatementConf; }); } declare class TSparkParameterValue { @@ -746,13 +607,22 @@ declare class TSparkParameterValue { constructor(args?: { stringValue?: string; doubleValue?: number; booleanValue?: boolean; }); } +declare class TSparkParameterValueArg { + public type?: string; + public value?: string; + public arguments?: TSparkParameterValueArg[]; + + constructor(args?: { type?: string; value?: string; arguments?: TSparkParameterValueArg[]; }); +} + declare class TSparkParameter { public ordinal?: number; public name?: string; public type?: string; public value?: TSparkParameterValue; + public arguments?: TSparkParameterValueArg[]; - constructor(args?: { ordinal?: number; name?: string; type?: string; value?: TSparkParameterValue; }); + constructor(args?: { ordinal?: number; name?: string; type?: string; value?: TSparkParameterValue; arguments?: TSparkParameterValueArg[]; }); } declare class TStatementConf { @@ -768,27 +638,16 @@ declare class TExecuteStatementResp { public status: TStatus; public operationHandle?: TOperationHandle; public directResults?: TSparkDirectResults; - public executionRejected?: boolean; - public maxClusterCapacity?: number; - public queryCost?: number; - public sessionConf?: TDBSqlSessionConf; - public currentClusterLoad?: number; - public idempotencyType?: TOperationIdempotencyType; - public remoteResultCacheEnabled?: boolean; - public isServerless?: boolean; - public operationHandles?: TOperationHandle[]; - constructor(args?: { status: TStatus; operationHandle?: TOperationHandle; directResults?: TSparkDirectResults; executionRejected?: boolean; maxClusterCapacity?: number; queryCost?: number; sessionConf?: TDBSqlSessionConf; currentClusterLoad?: number; idempotencyType?: TOperationIdempotencyType; remoteResultCacheEnabled?: boolean; isServerless?: boolean; operationHandles?: TOperationHandle[]; }); + constructor(args?: { status: TStatus; operationHandle?: TOperationHandle; directResults?: TSparkDirectResults; }); } declare class TGetTypeInfoReq { public sessionHandle: TSessionHandle; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetTypeInfoResp { @@ -803,10 +662,8 @@ declare class TGetCatalogsReq { public sessionHandle: TSessionHandle; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetCatalogsResp { @@ -823,10 +680,8 @@ declare class TGetSchemasReq { public schemaName?: string; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetSchemasResp { @@ -845,10 +700,8 @@ declare class TGetTablesReq { public tableTypes?: string[]; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; tableTypes?: string[]; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; tableTypes?: string[]; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetTablesResp { @@ -863,10 +716,8 @@ declare class TGetTableTypesReq { public sessionHandle: TSessionHandle; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetTableTypesResp { @@ -885,10 +736,8 @@ declare class TGetColumnsReq { public columnName?: string; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; columnName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; columnName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetColumnsResp { @@ -906,10 +755,8 @@ declare class TGetFunctionsReq { public functionName: string; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; functionName: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; functionName: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetFunctionsResp { @@ -927,10 +774,8 @@ declare class TGetPrimaryKeysReq { public tableName?: string; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; catalogName?: string; schemaName?: string; tableName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetPrimaryKeysResp { @@ -951,10 +796,8 @@ declare class TGetCrossReferenceReq { public foreignTableName?: string; public getDirectResults?: TSparkGetDirectResults; public runAsync?: boolean; - public operationId?: THandleIdentifier; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; parentCatalogName?: string; parentSchemaName?: string; parentTableName?: string; foreignCatalogName?: string; foreignSchemaName?: string; foreignTableName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; operationId?: THandleIdentifier; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; parentCatalogName?: string; parentSchemaName?: string; parentTableName?: string; foreignCatalogName?: string; foreignSchemaName?: string; foreignTableName?: string; getDirectResults?: TSparkGetDirectResults; runAsync?: boolean; }); } declare class TGetCrossReferenceResp { @@ -987,20 +830,14 @@ declare class TGetOperationStatusResp { public displayMessage?: string; public diagnosticInfo?: string; public errorDetailsJson?: string; - public responseValidation?: Buffer; - public idempotencyType?: TOperationIdempotencyType; - public statementTimeout?: Int64; - public statementTimeoutLevel?: TOperationTimeoutLevel; - constructor(args?: { status: TStatus; operationState?: TOperationState; sqlState?: string; errorCode?: number; errorMessage?: string; taskStatus?: string; operationStarted?: Int64; operationCompleted?: Int64; hasResultSet?: boolean; progressUpdateResponse?: TProgressUpdateResp; numModifiedRows?: Int64; displayMessage?: string; diagnosticInfo?: string; errorDetailsJson?: string; responseValidation?: Buffer; idempotencyType?: TOperationIdempotencyType; statementTimeout?: Int64; statementTimeoutLevel?: TOperationTimeoutLevel; }); + constructor(args?: { status: TStatus; operationState?: TOperationState; sqlState?: string; errorCode?: number; errorMessage?: string; taskStatus?: string; operationStarted?: Int64; operationCompleted?: Int64; hasResultSet?: boolean; progressUpdateResponse?: TProgressUpdateResp; numModifiedRows?: Int64; displayMessage?: string; diagnosticInfo?: string; errorDetailsJson?: string; }); } declare class TCancelOperationReq { public operationHandle: TOperationHandle; - public executionVersion?: number; - public replacedByNextAttempt?: boolean; - constructor(args?: { operationHandle: TOperationHandle; executionVersion?: number; replacedByNextAttempt?: boolean; }); + constructor(args?: { operationHandle: TOperationHandle; }); } declare class TCancelOperationResp { @@ -1011,9 +848,8 @@ declare class TCancelOperationResp { declare class TCloseOperationReq { public operationHandle: TOperationHandle; - public closeReason?: TDBSqlCloseOperationReason; - constructor(args?: { operationHandle: TOperationHandle; closeReason?: TDBSqlCloseOperationReason; }); + constructor(args?: { operationHandle: TOperationHandle; }); } declare class TCloseOperationResp { @@ -1024,9 +860,8 @@ declare class TCloseOperationResp { declare class TGetResultSetMetadataReq { public operationHandle: TOperationHandle; - public includeCloudResultFiles?: boolean; - constructor(args?: { operationHandle: TOperationHandle; includeCloudResultFiles?: boolean; }); + constructor(args?: { operationHandle: TOperationHandle; }); } declare class TGetResultSetMetadataResp { @@ -1039,20 +874,8 @@ declare class TGetResultSetMetadataResp { public uncompressedBytes?: Int64; public compressedBytes?: Int64; public isStagingOperation?: boolean; - public reasonForNoCloudFetch?: TCloudFetchDisabledReason; - public resultFiles?: TDBSqlCloudResultFile[]; - public manifestFile?: string; - public manifestFileFormat?: TDBSqlManifestFileFormat; - public cacheLookupLatency?: Int64; - public remoteCacheMissReason?: string; - public fetchDisposition?: TDBSqlFetchDisposition; - public remoteResultCacheEnabled?: boolean; - public isServerless?: boolean; - public resultDataFormat?: TDBSqlResultFormat; - public truncatedByThriftLimit?: boolean; - public resultByteLimit?: Int64; - - constructor(args?: { status: TStatus; schema?: TTableSchema; resultFormat?: TSparkRowSetType; lz4Compressed?: boolean; arrowSchema?: Buffer; cacheLookupResult?: TCacheLookupResult; uncompressedBytes?: Int64; compressedBytes?: Int64; isStagingOperation?: boolean; reasonForNoCloudFetch?: TCloudFetchDisabledReason; resultFiles?: TDBSqlCloudResultFile[]; manifestFile?: string; manifestFileFormat?: TDBSqlManifestFileFormat; cacheLookupLatency?: Int64; remoteCacheMissReason?: string; fetchDisposition?: TDBSqlFetchDisposition; remoteResultCacheEnabled?: boolean; isServerless?: boolean; resultDataFormat?: TDBSqlResultFormat; truncatedByThriftLimit?: boolean; resultByteLimit?: Int64; }); + + constructor(args?: { status: TStatus; schema?: TTableSchema; resultFormat?: TSparkRowSetType; lz4Compressed?: boolean; arrowSchema?: Buffer; cacheLookupResult?: TCacheLookupResult; uncompressedBytes?: Int64; compressedBytes?: Int64; isStagingOperation?: boolean; }); } declare class TFetchResultsReq { @@ -1072,18 +895,16 @@ declare class TFetchResultsResp { public hasMoreRows?: boolean; public results?: TRowSet; public resultSetMetadata?: TGetResultSetMetadataResp; - public responseValidation?: Buffer; - constructor(args?: { status: TStatus; hasMoreRows?: boolean; results?: TRowSet; resultSetMetadata?: TGetResultSetMetadataResp; responseValidation?: Buffer; }); + constructor(args?: { status: TStatus; hasMoreRows?: boolean; results?: TRowSet; resultSetMetadata?: TGetResultSetMetadataResp; }); } declare class TGetDelegationTokenReq { public sessionHandle: TSessionHandle; public owner: string; public renewer: string; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; owner: string; renewer: string; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; owner: string; renewer: string; }); } declare class TGetDelegationTokenResp { @@ -1096,9 +917,8 @@ declare class TGetDelegationTokenResp { declare class TCancelDelegationTokenReq { public sessionHandle: TSessionHandle; public delegationToken: string; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; delegationToken: string; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; delegationToken: string; }); } declare class TCancelDelegationTokenResp { @@ -1110,9 +930,8 @@ declare class TCancelDelegationTokenResp { declare class TRenewDelegationTokenReq { public sessionHandle: TSessionHandle; public delegationToken: string; - public sessionConf?: TDBSqlSessionConf; - constructor(args?: { sessionHandle: TSessionHandle; delegationToken: string; sessionConf?: TDBSqlSessionConf; }); + constructor(args?: { sessionHandle: TSessionHandle; delegationToken: string; }); } declare class TRenewDelegationTokenResp { diff --git a/thrift/TCLIService_types.js b/thrift/TCLIService_types.js index 7eb913e2..bc51a96c 100644 --- a/thrift/TCLIService_types.js +++ b/thrift/TCLIService_types.js @@ -52,7 +52,9 @@ ttypes.TProtocolVersion = { '42247' : 'SPARK_CLI_SERVICE_PROTOCOL_V7', 'SPARK_CLI_SERVICE_PROTOCOL_V7' : 42247, '42248' : 'SPARK_CLI_SERVICE_PROTOCOL_V8', - 'SPARK_CLI_SERVICE_PROTOCOL_V8' : 42248 + 'SPARK_CLI_SERVICE_PROTOCOL_V8' : 42248, + '42249' : 'SPARK_CLI_SERVICE_PROTOCOL_V9', + 'SPARK_CLI_SERVICE_PROTOCOL_V9' : 42249 }; ttypes.TTypeId = { '0' : 'BOOLEAN_TYPE', @@ -124,20 +126,6 @@ ttypes.TDBSqlArrowLayout = { '1' : 'ARROW_STREAMING', 'ARROW_STREAMING' : 1 }; -ttypes.TOperationIdempotencyType = { - '0' : 'UNKNOWN', - 'UNKNOWN' : 0, - '1' : 'NON_IDEMPOTENT', - 'NON_IDEMPOTENT' : 1, - '2' : 'IDEMPOTENT', - 'IDEMPOTENT' : 2 -}; -ttypes.TOperationTimeoutLevel = { - '0' : 'CLUSTER', - 'CLUSTER' : 0, - '1' : 'SESSION', - 'SESSION' : 1 -}; ttypes.TStatusCode = { '0' : 'SUCCESS_STATUS', 'SUCCESS_STATUS' : 0, @@ -286,20 +274,6 @@ ttypes.TGetInfoType = { '10005' : 'CLI_MAX_IDENTIFIER_LEN', 'CLI_MAX_IDENTIFIER_LEN' : 10005 }; -ttypes.TResultPersistenceMode = { - '0' : 'ONLY_LARGE_RESULTS', - 'ONLY_LARGE_RESULTS' : 0, - '1' : 'ALL_QUERY_RESULTS', - 'ALL_QUERY_RESULTS' : 1, - '2' : 'ALL_RESULTS', - 'ALL_RESULTS' : 2 -}; -ttypes.TDBSqlCloseOperationReason = { - '0' : 'NONE', - 'NONE' : 0, - '1' : 'COMMAND_INACTIVITY_TIMEOUT', - 'COMMAND_INACTIVITY_TIMEOUT' : 1 -}; ttypes.TCacheLookupResult = { '0' : 'CACHE_INELIGIBLE', 'CACHE_INELIGIBLE' : 0, @@ -310,28 +284,6 @@ ttypes.TCacheLookupResult = { '3' : 'CACHE_MISS', 'CACHE_MISS' : 3 }; -ttypes.TCloudFetchDisabledReason = { - '0' : 'ARROW_SUPPORT', - 'ARROW_SUPPORT' : 0, - '1' : 'CLOUD_FETCH_SUPPORT', - 'CLOUD_FETCH_SUPPORT' : 1, - '2' : 'PROTOCOL_VERSION', - 'PROTOCOL_VERSION' : 2, - '3' : 'REGION_SUPPORT', - 'REGION_SUPPORT' : 3, - '4' : 'BLOCKLISTED_OPERATION', - 'BLOCKLISTED_OPERATION' : 4, - '5' : 'SMALL_RESULT_SIZE', - 'SMALL_RESULT_SIZE' : 5, - '6' : 'CUSTOMER_STORAGE_SUPPORT', - 'CUSTOMER_STORAGE_SUPPORT' : 6, - '7' : 'UNKNOWN', - 'UNKNOWN' : 7 -}; -ttypes.TDBSqlManifestFileFormat = { - '0' : 'THRIFT_GET_RESULT_SET_METADATA_RESP', - 'THRIFT_GET_RESULT_SET_METADATA_RESP' : 0 -}; ttypes.TFetchOrientation = { '0' : 'FETCH_NEXT', 'FETCH_NEXT' : 0, @@ -346,16 +298,6 @@ ttypes.TFetchOrientation = { '5' : 'FETCH_LAST', 'FETCH_LAST' : 5 }; -ttypes.TDBSqlFetchDisposition = { - '0' : 'DISPOSITION_UNSPECIFIED', - 'DISPOSITION_UNSPECIFIED' : 0, - '1' : 'DISPOSITION_INLINE', - 'DISPOSITION_INLINE' : 1, - '2' : 'DISPOSITION_EXTERNAL_LINKS', - 'DISPOSITION_EXTERNAL_LINKS' : 2, - '3' : 'DISPOSITION_INTERNAL_DBFS', - 'DISPOSITION_INTERNAL_DBFS' : 3 -}; ttypes.TJobExecutionStatus = { '0' : 'IN_PROGRESS', 'IN_PROGRESS' : 0, @@ -3104,183 +3046,6 @@ TSparkArrowResultLink.prototype.write = function(output) { return; }; -var TDBSqlCloudResultFile = module.exports.TDBSqlCloudResultFile = function(args) { - this.filePath = null; - this.startRowOffset = null; - this.rowCount = null; - this.uncompressedBytes = null; - this.compressedBytes = null; - this.fileLink = null; - this.linkExpiryTime = null; - this.httpHeaders = null; - if (args) { - if (args.filePath !== undefined && args.filePath !== null) { - this.filePath = args.filePath; - } - if (args.startRowOffset !== undefined && args.startRowOffset !== null) { - this.startRowOffset = args.startRowOffset; - } - if (args.rowCount !== undefined && args.rowCount !== null) { - this.rowCount = args.rowCount; - } - if (args.uncompressedBytes !== undefined && args.uncompressedBytes !== null) { - this.uncompressedBytes = args.uncompressedBytes; - } - if (args.compressedBytes !== undefined && args.compressedBytes !== null) { - this.compressedBytes = args.compressedBytes; - } - if (args.fileLink !== undefined && args.fileLink !== null) { - this.fileLink = args.fileLink; - } - if (args.linkExpiryTime !== undefined && args.linkExpiryTime !== null) { - this.linkExpiryTime = args.linkExpiryTime; - } - if (args.httpHeaders !== undefined && args.httpHeaders !== null) { - this.httpHeaders = Thrift.copyMap(args.httpHeaders, [null]); - } - } -}; -TDBSqlCloudResultFile.prototype = {}; -TDBSqlCloudResultFile.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.filePath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.startRowOffset = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.rowCount = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.uncompressedBytes = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.compressedBytes = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.STRING) { - this.fileLink = input.readString(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I64) { - this.linkExpiryTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.MAP) { - this.httpHeaders = {}; - var _rtmp384 = input.readMapBegin(); - var _size83 = _rtmp384.size || 0; - for (var _i85 = 0; _i85 < _size83; ++_i85) { - var key86 = null; - var val87 = null; - key86 = input.readString(); - val87 = input.readString(); - this.httpHeaders[key86] = val87; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDBSqlCloudResultFile.prototype.write = function(output) { - output.writeStructBegin('TDBSqlCloudResultFile'); - if (this.filePath !== null && this.filePath !== undefined) { - output.writeFieldBegin('filePath', Thrift.Type.STRING, 1); - output.writeString(this.filePath); - output.writeFieldEnd(); - } - if (this.startRowOffset !== null && this.startRowOffset !== undefined) { - output.writeFieldBegin('startRowOffset', Thrift.Type.I64, 2); - output.writeI64(this.startRowOffset); - output.writeFieldEnd(); - } - if (this.rowCount !== null && this.rowCount !== undefined) { - output.writeFieldBegin('rowCount', Thrift.Type.I64, 3); - output.writeI64(this.rowCount); - output.writeFieldEnd(); - } - if (this.uncompressedBytes !== null && this.uncompressedBytes !== undefined) { - output.writeFieldBegin('uncompressedBytes', Thrift.Type.I64, 4); - output.writeI64(this.uncompressedBytes); - output.writeFieldEnd(); - } - if (this.compressedBytes !== null && this.compressedBytes !== undefined) { - output.writeFieldBegin('compressedBytes', Thrift.Type.I64, 5); - output.writeI64(this.compressedBytes); - output.writeFieldEnd(); - } - if (this.fileLink !== null && this.fileLink !== undefined) { - output.writeFieldBegin('fileLink', Thrift.Type.STRING, 6); - output.writeString(this.fileLink); - output.writeFieldEnd(); - } - if (this.linkExpiryTime !== null && this.linkExpiryTime !== undefined) { - output.writeFieldBegin('linkExpiryTime', Thrift.Type.I64, 7); - output.writeI64(this.linkExpiryTime); - output.writeFieldEnd(); - } - if (this.httpHeaders !== null && this.httpHeaders !== undefined) { - output.writeFieldBegin('httpHeaders', Thrift.Type.MAP, 8); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.httpHeaders)); - for (var kiter88 in this.httpHeaders) { - if (this.httpHeaders.hasOwnProperty(kiter88)) { - var viter89 = this.httpHeaders[kiter88]; - output.writeString(kiter88); - output.writeString(viter89); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - var TRowSet = module.exports.TRowSet = function(args) { this.startRowOffset = null; this.rows = null; @@ -3289,7 +3054,6 @@ var TRowSet = module.exports.TRowSet = function(args) { this.columnCount = null; this.arrowBatches = null; this.resultLinks = null; - this.cloudFetchResults = null; if (args) { if (args.startRowOffset !== undefined && args.startRowOffset !== null) { this.startRowOffset = args.startRowOffset; @@ -3316,9 +3080,6 @@ var TRowSet = module.exports.TRowSet = function(args) { if (args.resultLinks !== undefined && args.resultLinks !== null) { this.resultLinks = Thrift.copyList(args.resultLinks, [ttypes.TSparkArrowResultLink]); } - if (args.cloudFetchResults !== undefined && args.cloudFetchResults !== null) { - this.cloudFetchResults = Thrift.copyList(args.cloudFetchResults, [ttypes.TDBSqlCloudResultFile]); - } } }; TRowSet.prototype = {}; @@ -3342,13 +3103,13 @@ TRowSet.prototype.read = function(input) { case 2: if (ftype == Thrift.Type.LIST) { this.rows = []; - var _rtmp391 = input.readListBegin(); - var _size90 = _rtmp391.size || 0; - for (var _i92 = 0; _i92 < _size90; ++_i92) { - var elem93 = null; - elem93 = new ttypes.TRow(); - elem93.read(input); - this.rows.push(elem93); + var _rtmp384 = input.readListBegin(); + var _size83 = _rtmp384.size || 0; + for (var _i85 = 0; _i85 < _size83; ++_i85) { + var elem86 = null; + elem86 = new ttypes.TRow(); + elem86.read(input); + this.rows.push(elem86); } input.readListEnd(); } else { @@ -3358,13 +3119,13 @@ TRowSet.prototype.read = function(input) { case 3: if (ftype == Thrift.Type.LIST) { this.columns = []; - var _rtmp395 = input.readListBegin(); - var _size94 = _rtmp395.size || 0; - for (var _i96 = 0; _i96 < _size94; ++_i96) { - var elem97 = null; - elem97 = new ttypes.TColumn(); - elem97.read(input); - this.columns.push(elem97); + var _rtmp388 = input.readListBegin(); + var _size87 = _rtmp388.size || 0; + for (var _i89 = 0; _i89 < _size87; ++_i89) { + var elem90 = null; + elem90 = new ttypes.TColumn(); + elem90.read(input); + this.columns.push(elem90); } input.readListEnd(); } else { @@ -3388,13 +3149,13 @@ TRowSet.prototype.read = function(input) { case 1281: if (ftype == Thrift.Type.LIST) { this.arrowBatches = []; - var _rtmp399 = input.readListBegin(); - var _size98 = _rtmp399.size || 0; - for (var _i100 = 0; _i100 < _size98; ++_i100) { - var elem101 = null; - elem101 = new ttypes.TSparkArrowBatch(); - elem101.read(input); - this.arrowBatches.push(elem101); + var _rtmp392 = input.readListBegin(); + var _size91 = _rtmp392.size || 0; + for (var _i93 = 0; _i93 < _size91; ++_i93) { + var elem94 = null; + elem94 = new ttypes.TSparkArrowBatch(); + elem94.read(input); + this.arrowBatches.push(elem94); } input.readListEnd(); } else { @@ -3404,29 +3165,13 @@ TRowSet.prototype.read = function(input) { case 1282: if (ftype == Thrift.Type.LIST) { this.resultLinks = []; - var _rtmp3103 = input.readListBegin(); - var _size102 = _rtmp3103.size || 0; - for (var _i104 = 0; _i104 < _size102; ++_i104) { - var elem105 = null; - elem105 = new ttypes.TSparkArrowResultLink(); - elem105.read(input); - this.resultLinks.push(elem105); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3329: - if (ftype == Thrift.Type.LIST) { - this.cloudFetchResults = []; - var _rtmp3107 = input.readListBegin(); - var _size106 = _rtmp3107.size || 0; - for (var _i108 = 0; _i108 < _size106; ++_i108) { - var elem109 = null; - elem109 = new ttypes.TDBSqlCloudResultFile(); - elem109.read(input); - this.cloudFetchResults.push(elem109); + var _rtmp396 = input.readListBegin(); + var _size95 = _rtmp396.size || 0; + for (var _i97 = 0; _i97 < _size95; ++_i97) { + var elem98 = null; + elem98 = new ttypes.TSparkArrowResultLink(); + elem98.read(input); + this.resultLinks.push(elem98); } input.readListEnd(); } else { @@ -3452,10 +3197,10 @@ TRowSet.prototype.write = function(output) { if (this.rows !== null && this.rows !== undefined) { output.writeFieldBegin('rows', Thrift.Type.LIST, 2); output.writeListBegin(Thrift.Type.STRUCT, this.rows.length); - for (var iter110 in this.rows) { - if (this.rows.hasOwnProperty(iter110)) { - iter110 = this.rows[iter110]; - iter110.write(output); + for (var iter99 in this.rows) { + if (this.rows.hasOwnProperty(iter99)) { + iter99 = this.rows[iter99]; + iter99.write(output); } } output.writeListEnd(); @@ -3464,10 +3209,10 @@ TRowSet.prototype.write = function(output) { if (this.columns !== null && this.columns !== undefined) { output.writeFieldBegin('columns', Thrift.Type.LIST, 3); output.writeListBegin(Thrift.Type.STRUCT, this.columns.length); - for (var iter111 in this.columns) { - if (this.columns.hasOwnProperty(iter111)) { - iter111 = this.columns[iter111]; - iter111.write(output); + for (var iter100 in this.columns) { + if (this.columns.hasOwnProperty(iter100)) { + iter100 = this.columns[iter100]; + iter100.write(output); } } output.writeListEnd(); @@ -3486,10 +3231,10 @@ TRowSet.prototype.write = function(output) { if (this.arrowBatches !== null && this.arrowBatches !== undefined) { output.writeFieldBegin('arrowBatches', Thrift.Type.LIST, 1281); output.writeListBegin(Thrift.Type.STRUCT, this.arrowBatches.length); - for (var iter112 in this.arrowBatches) { - if (this.arrowBatches.hasOwnProperty(iter112)) { - iter112 = this.arrowBatches[iter112]; - iter112.write(output); + for (var iter101 in this.arrowBatches) { + if (this.arrowBatches.hasOwnProperty(iter101)) { + iter101 = this.arrowBatches[iter101]; + iter101.write(output); } } output.writeListEnd(); @@ -3498,22 +3243,10 @@ TRowSet.prototype.write = function(output) { if (this.resultLinks !== null && this.resultLinks !== undefined) { output.writeFieldBegin('resultLinks', Thrift.Type.LIST, 1282); output.writeListBegin(Thrift.Type.STRUCT, this.resultLinks.length); - for (var iter113 in this.resultLinks) { - if (this.resultLinks.hasOwnProperty(iter113)) { - iter113 = this.resultLinks[iter113]; - iter113.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.cloudFetchResults !== null && this.cloudFetchResults !== undefined) { - output.writeFieldBegin('cloudFetchResults', Thrift.Type.LIST, 3329); - output.writeListBegin(Thrift.Type.STRUCT, this.cloudFetchResults.length); - for (var iter114 in this.cloudFetchResults) { - if (this.cloudFetchResults.hasOwnProperty(iter114)) { - iter114 = this.cloudFetchResults[iter114]; - iter114.write(output); + for (var iter102 in this.resultLinks) { + if (this.resultLinks.hasOwnProperty(iter102)) { + iter102 = this.resultLinks[iter102]; + iter102.write(output); } } output.writeListEnd(); @@ -3524,28 +3257,42 @@ TRowSet.prototype.write = function(output) { return; }; -var TDBSqlTempView = module.exports.TDBSqlTempView = function(args) { - this.name = null; - this.sqlStatement = null; - this.properties = null; - this.viewSchema = null; +var TStatus = module.exports.TStatus = function(args) { + this.statusCode = null; + this.infoMessages = null; + this.sqlState = null; + this.errorCode = null; + this.errorMessage = null; + this.displayMessage = null; + this.errorDetailsJson = null; if (args) { - if (args.name !== undefined && args.name !== null) { - this.name = args.name; + if (args.statusCode !== undefined && args.statusCode !== null) { + this.statusCode = args.statusCode; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statusCode is unset!'); + } + if (args.infoMessages !== undefined && args.infoMessages !== null) { + this.infoMessages = Thrift.copyList(args.infoMessages, [null]); + } + if (args.sqlState !== undefined && args.sqlState !== null) { + this.sqlState = args.sqlState; + } + if (args.errorCode !== undefined && args.errorCode !== null) { + this.errorCode = args.errorCode; } - if (args.sqlStatement !== undefined && args.sqlStatement !== null) { - this.sqlStatement = args.sqlStatement; + if (args.errorMessage !== undefined && args.errorMessage !== null) { + this.errorMessage = args.errorMessage; } - if (args.properties !== undefined && args.properties !== null) { - this.properties = Thrift.copyMap(args.properties, [null]); + if (args.displayMessage !== undefined && args.displayMessage !== null) { + this.displayMessage = args.displayMessage; } - if (args.viewSchema !== undefined && args.viewSchema !== null) { - this.viewSchema = args.viewSchema; + if (args.errorDetailsJson !== undefined && args.errorDetailsJson !== null) { + this.errorDetailsJson = args.errorDetailsJson; } } }; -TDBSqlTempView.prototype = {}; -TDBSqlTempView.prototype.read = function(input) { +TStatus.prototype = {}; +TStatus.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -3556,39 +3303,58 @@ TDBSqlTempView.prototype.read = function(input) { } switch (fid) { case 1: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); + if (ftype == Thrift.Type.I32) { + this.statusCode = input.readI32(); } else { input.skip(ftype); } break; case 2: - if (ftype == Thrift.Type.STRING) { - this.sqlStatement = input.readString(); + if (ftype == Thrift.Type.LIST) { + this.infoMessages = []; + var _rtmp3104 = input.readListBegin(); + var _size103 = _rtmp3104.size || 0; + for (var _i105 = 0; _i105 < _size103; ++_i105) { + var elem106 = null; + elem106 = input.readString(); + this.infoMessages.push(elem106); + } + input.readListEnd(); } else { input.skip(ftype); } break; case 3: - if (ftype == Thrift.Type.MAP) { - this.properties = {}; - var _rtmp3116 = input.readMapBegin(); - var _size115 = _rtmp3116.size || 0; - for (var _i117 = 0; _i117 < _size115; ++_i117) { - var key118 = null; - var val119 = null; - key118 = input.readString(); - val119 = input.readString(); - this.properties[key118] = val119; - } - input.readMapEnd(); + if (ftype == Thrift.Type.STRING) { + this.sqlState = input.readString(); } else { input.skip(ftype); } break; case 4: + if (ftype == Thrift.Type.I32) { + this.errorCode = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRING) { + this.errorMessage = input.readString(); + } else { + input.skip(ftype); + } + break; + case 6: if (ftype == Thrift.Type.STRING) { - this.viewSchema = input.readString(); + this.displayMessage = input.readString(); + } else { + input.skip(ftype); + } + break; + case 1281: + if (ftype == Thrift.Type.STRING) { + this.errorDetailsJson = input.readString(); } else { input.skip(ftype); } @@ -3602,721 +3368,28 @@ TDBSqlTempView.prototype.read = function(input) { return; }; -TDBSqlTempView.prototype.write = function(output) { - output.writeStructBegin('TDBSqlTempView'); - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 1); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.sqlStatement !== null && this.sqlStatement !== undefined) { - output.writeFieldBegin('sqlStatement', Thrift.Type.STRING, 2); - output.writeString(this.sqlStatement); +TStatus.prototype.write = function(output) { + output.writeStructBegin('TStatus'); + if (this.statusCode !== null && this.statusCode !== undefined) { + output.writeFieldBegin('statusCode', Thrift.Type.I32, 1); + output.writeI32(this.statusCode); output.writeFieldEnd(); } - if (this.properties !== null && this.properties !== undefined) { - output.writeFieldBegin('properties', Thrift.Type.MAP, 3); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.properties)); - for (var kiter120 in this.properties) { - if (this.properties.hasOwnProperty(kiter120)) { - var viter121 = this.properties[kiter120]; - output.writeString(kiter120); - output.writeString(viter121); + if (this.infoMessages !== null && this.infoMessages !== undefined) { + output.writeFieldBegin('infoMessages', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.infoMessages.length); + for (var iter107 in this.infoMessages) { + if (this.infoMessages.hasOwnProperty(iter107)) { + iter107 = this.infoMessages[iter107]; + output.writeString(iter107); } } - output.writeMapEnd(); + output.writeListEnd(); output.writeFieldEnd(); } - if (this.viewSchema !== null && this.viewSchema !== undefined) { - output.writeFieldBegin('viewSchema', Thrift.Type.STRING, 4); - output.writeString(this.viewSchema); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TDBSqlSessionCapabilities = module.exports.TDBSqlSessionCapabilities = function(args) { - this.supportsMultipleCatalogs = null; - if (args) { - if (args.supportsMultipleCatalogs !== undefined && args.supportsMultipleCatalogs !== null) { - this.supportsMultipleCatalogs = args.supportsMultipleCatalogs; - } - } -}; -TDBSqlSessionCapabilities.prototype = {}; -TDBSqlSessionCapabilities.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.BOOL) { - this.supportsMultipleCatalogs = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDBSqlSessionCapabilities.prototype.write = function(output) { - output.writeStructBegin('TDBSqlSessionCapabilities'); - if (this.supportsMultipleCatalogs !== null && this.supportsMultipleCatalogs !== undefined) { - output.writeFieldBegin('supportsMultipleCatalogs', Thrift.Type.BOOL, 1); - output.writeBool(this.supportsMultipleCatalogs); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TExpressionInfo = module.exports.TExpressionInfo = function(args) { - this.className = null; - this.usage = null; - this.name = null; - this.extended = null; - this.db = null; - this.arguments = null; - this.examples = null; - this.note = null; - this.group = null; - this.since = null; - this.deprecated = null; - this.source = null; - if (args) { - if (args.className !== undefined && args.className !== null) { - this.className = args.className; - } - if (args.usage !== undefined && args.usage !== null) { - this.usage = args.usage; - } - if (args.name !== undefined && args.name !== null) { - this.name = args.name; - } - if (args.extended !== undefined && args.extended !== null) { - this.extended = args.extended; - } - if (args.db !== undefined && args.db !== null) { - this.db = args.db; - } - if (args.arguments !== undefined && args.arguments !== null) { - this.arguments = args.arguments; - } - if (args.examples !== undefined && args.examples !== null) { - this.examples = args.examples; - } - if (args.note !== undefined && args.note !== null) { - this.note = args.note; - } - if (args.group !== undefined && args.group !== null) { - this.group = args.group; - } - if (args.since !== undefined && args.since !== null) { - this.since = args.since; - } - if (args.deprecated !== undefined && args.deprecated !== null) { - this.deprecated = args.deprecated; - } - if (args.source !== undefined && args.source !== null) { - this.source = args.source; - } - } -}; -TExpressionInfo.prototype = {}; -TExpressionInfo.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.className = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.usage = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.extended = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRING) { - this.db = input.readString(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.STRING) { - this.arguments = input.readString(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.STRING) { - this.examples = input.readString(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.STRING) { - this.note = input.readString(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.STRING) { - this.group = input.readString(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.STRING) { - this.since = input.readString(); - } else { - input.skip(ftype); - } - break; - case 11: - if (ftype == Thrift.Type.STRING) { - this.deprecated = input.readString(); - } else { - input.skip(ftype); - } - break; - case 12: - if (ftype == Thrift.Type.STRING) { - this.source = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TExpressionInfo.prototype.write = function(output) { - output.writeStructBegin('TExpressionInfo'); - if (this.className !== null && this.className !== undefined) { - output.writeFieldBegin('className', Thrift.Type.STRING, 1); - output.writeString(this.className); - output.writeFieldEnd(); - } - if (this.usage !== null && this.usage !== undefined) { - output.writeFieldBegin('usage', Thrift.Type.STRING, 2); - output.writeString(this.usage); - output.writeFieldEnd(); - } - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 3); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.extended !== null && this.extended !== undefined) { - output.writeFieldBegin('extended', Thrift.Type.STRING, 4); - output.writeString(this.extended); - output.writeFieldEnd(); - } - if (this.db !== null && this.db !== undefined) { - output.writeFieldBegin('db', Thrift.Type.STRING, 5); - output.writeString(this.db); - output.writeFieldEnd(); - } - if (this.arguments !== null && this.arguments !== undefined) { - output.writeFieldBegin('arguments', Thrift.Type.STRING, 6); - output.writeString(this.arguments); - output.writeFieldEnd(); - } - if (this.examples !== null && this.examples !== undefined) { - output.writeFieldBegin('examples', Thrift.Type.STRING, 7); - output.writeString(this.examples); - output.writeFieldEnd(); - } - if (this.note !== null && this.note !== undefined) { - output.writeFieldBegin('note', Thrift.Type.STRING, 8); - output.writeString(this.note); - output.writeFieldEnd(); - } - if (this.group !== null && this.group !== undefined) { - output.writeFieldBegin('group', Thrift.Type.STRING, 9); - output.writeString(this.group); - output.writeFieldEnd(); - } - if (this.since !== null && this.since !== undefined) { - output.writeFieldBegin('since', Thrift.Type.STRING, 10); - output.writeString(this.since); - output.writeFieldEnd(); - } - if (this.deprecated !== null && this.deprecated !== undefined) { - output.writeFieldBegin('deprecated', Thrift.Type.STRING, 11); - output.writeString(this.deprecated); - output.writeFieldEnd(); - } - if (this.source !== null && this.source !== undefined) { - output.writeFieldBegin('source', Thrift.Type.STRING, 12); - output.writeString(this.source); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TDBSqlConfValue = module.exports.TDBSqlConfValue = function(args) { - this.value = null; - if (args) { - if (args.value !== undefined && args.value !== null) { - this.value = args.value; - } - } -}; -TDBSqlConfValue.prototype = {}; -TDBSqlConfValue.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.value = input.readString(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDBSqlConfValue.prototype.write = function(output) { - output.writeStructBegin('TDBSqlConfValue'); - if (this.value !== null && this.value !== undefined) { - output.writeFieldBegin('value', Thrift.Type.STRING, 1); - output.writeString(this.value); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TDBSqlSessionConf = module.exports.TDBSqlSessionConf = function(args) { - this.confs = null; - this.tempViews = null; - this.currentDatabase = null; - this.currentCatalog = null; - this.sessionCapabilities = null; - this.expressionsInfos = null; - this.internalConfs = null; - if (args) { - if (args.confs !== undefined && args.confs !== null) { - this.confs = Thrift.copyMap(args.confs, [null]); - } - if (args.tempViews !== undefined && args.tempViews !== null) { - this.tempViews = Thrift.copyList(args.tempViews, [ttypes.TDBSqlTempView]); - } - if (args.currentDatabase !== undefined && args.currentDatabase !== null) { - this.currentDatabase = args.currentDatabase; - } - if (args.currentCatalog !== undefined && args.currentCatalog !== null) { - this.currentCatalog = args.currentCatalog; - } - if (args.sessionCapabilities !== undefined && args.sessionCapabilities !== null) { - this.sessionCapabilities = new ttypes.TDBSqlSessionCapabilities(args.sessionCapabilities); - } - if (args.expressionsInfos !== undefined && args.expressionsInfos !== null) { - this.expressionsInfos = Thrift.copyList(args.expressionsInfos, [ttypes.TExpressionInfo]); - } - if (args.internalConfs !== undefined && args.internalConfs !== null) { - this.internalConfs = Thrift.copyMap(args.internalConfs, [ttypes.TDBSqlConfValue]); - } - } -}; -TDBSqlSessionConf.prototype = {}; -TDBSqlSessionConf.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.MAP) { - this.confs = {}; - var _rtmp3123 = input.readMapBegin(); - var _size122 = _rtmp3123.size || 0; - for (var _i124 = 0; _i124 < _size122; ++_i124) { - var key125 = null; - var val126 = null; - key125 = input.readString(); - val126 = input.readString(); - this.confs[key125] = val126; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.tempViews = []; - var _rtmp3128 = input.readListBegin(); - var _size127 = _rtmp3128.size || 0; - for (var _i129 = 0; _i129 < _size127; ++_i129) { - var elem130 = null; - elem130 = new ttypes.TDBSqlTempView(); - elem130.read(input); - this.tempViews.push(elem130); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.currentDatabase = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.currentCatalog = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRUCT) { - this.sessionCapabilities = new ttypes.TDBSqlSessionCapabilities(); - this.sessionCapabilities.read(input); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.expressionsInfos = []; - var _rtmp3132 = input.readListBegin(); - var _size131 = _rtmp3132.size || 0; - for (var _i133 = 0; _i133 < _size131; ++_i133) { - var elem134 = null; - elem134 = new ttypes.TExpressionInfo(); - elem134.read(input); - this.expressionsInfos.push(elem134); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.MAP) { - this.internalConfs = {}; - var _rtmp3136 = input.readMapBegin(); - var _size135 = _rtmp3136.size || 0; - for (var _i137 = 0; _i137 < _size135; ++_i137) { - var key138 = null; - var val139 = null; - key138 = input.readString(); - val139 = new ttypes.TDBSqlConfValue(); - val139.read(input); - this.internalConfs[key138] = val139; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDBSqlSessionConf.prototype.write = function(output) { - output.writeStructBegin('TDBSqlSessionConf'); - if (this.confs !== null && this.confs !== undefined) { - output.writeFieldBegin('confs', Thrift.Type.MAP, 1); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.confs)); - for (var kiter140 in this.confs) { - if (this.confs.hasOwnProperty(kiter140)) { - var viter141 = this.confs[kiter140]; - output.writeString(kiter140); - output.writeString(viter141); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.tempViews !== null && this.tempViews !== undefined) { - output.writeFieldBegin('tempViews', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRUCT, this.tempViews.length); - for (var iter142 in this.tempViews) { - if (this.tempViews.hasOwnProperty(iter142)) { - iter142 = this.tempViews[iter142]; - iter142.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.currentDatabase !== null && this.currentDatabase !== undefined) { - output.writeFieldBegin('currentDatabase', Thrift.Type.STRING, 3); - output.writeString(this.currentDatabase); - output.writeFieldEnd(); - } - if (this.currentCatalog !== null && this.currentCatalog !== undefined) { - output.writeFieldBegin('currentCatalog', Thrift.Type.STRING, 4); - output.writeString(this.currentCatalog); - output.writeFieldEnd(); - } - if (this.sessionCapabilities !== null && this.sessionCapabilities !== undefined) { - output.writeFieldBegin('sessionCapabilities', Thrift.Type.STRUCT, 5); - this.sessionCapabilities.write(output); - output.writeFieldEnd(); - } - if (this.expressionsInfos !== null && this.expressionsInfos !== undefined) { - output.writeFieldBegin('expressionsInfos', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.STRUCT, this.expressionsInfos.length); - for (var iter143 in this.expressionsInfos) { - if (this.expressionsInfos.hasOwnProperty(iter143)) { - iter143 = this.expressionsInfos[iter143]; - iter143.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.internalConfs !== null && this.internalConfs !== undefined) { - output.writeFieldBegin('internalConfs', Thrift.Type.MAP, 7); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.internalConfs)); - for (var kiter144 in this.internalConfs) { - if (this.internalConfs.hasOwnProperty(kiter144)) { - var viter145 = this.internalConfs[kiter144]; - output.writeString(kiter144); - viter145.write(output); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TStatus = module.exports.TStatus = function(args) { - this.statusCode = null; - this.infoMessages = null; - this.sqlState = null; - this.errorCode = null; - this.errorMessage = null; - this.displayMessage = null; - this.errorDetailsJson = null; - this.responseValidation = null; - if (args) { - if (args.statusCode !== undefined && args.statusCode !== null) { - this.statusCode = args.statusCode; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statusCode is unset!'); - } - if (args.infoMessages !== undefined && args.infoMessages !== null) { - this.infoMessages = Thrift.copyList(args.infoMessages, [null]); - } - if (args.sqlState !== undefined && args.sqlState !== null) { - this.sqlState = args.sqlState; - } - if (args.errorCode !== undefined && args.errorCode !== null) { - this.errorCode = args.errorCode; - } - if (args.errorMessage !== undefined && args.errorMessage !== null) { - this.errorMessage = args.errorMessage; - } - if (args.displayMessage !== undefined && args.displayMessage !== null) { - this.displayMessage = args.displayMessage; - } - if (args.errorDetailsJson !== undefined && args.errorDetailsJson !== null) { - this.errorDetailsJson = args.errorDetailsJson; - } - if (args.responseValidation !== undefined && args.responseValidation !== null) { - this.responseValidation = args.responseValidation; - } - } -}; -TStatus.prototype = {}; -TStatus.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.statusCode = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.infoMessages = []; - var _rtmp3147 = input.readListBegin(); - var _size146 = _rtmp3147.size || 0; - for (var _i148 = 0; _i148 < _size146; ++_i148) { - var elem149 = null; - elem149 = input.readString(); - this.infoMessages.push(elem149); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.sqlState = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.errorCode = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRING) { - this.errorMessage = input.readString(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.STRING) { - this.displayMessage = input.readString(); - } else { - input.skip(ftype); - } - break; - case 1281: - if (ftype == Thrift.Type.STRING) { - this.errorDetailsJson = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3329: - if (ftype == Thrift.Type.STRING) { - this.responseValidation = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TStatus.prototype.write = function(output) { - output.writeStructBegin('TStatus'); - if (this.statusCode !== null && this.statusCode !== undefined) { - output.writeFieldBegin('statusCode', Thrift.Type.I32, 1); - output.writeI32(this.statusCode); - output.writeFieldEnd(); - } - if (this.infoMessages !== null && this.infoMessages !== undefined) { - output.writeFieldBegin('infoMessages', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.infoMessages.length); - for (var iter150 in this.infoMessages) { - if (this.infoMessages.hasOwnProperty(iter150)) { - iter150 = this.infoMessages[iter150]; - output.writeString(iter150); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.sqlState !== null && this.sqlState !== undefined) { - output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3); - output.writeString(this.sqlState); + if (this.sqlState !== null && this.sqlState !== undefined) { + output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3); + output.writeString(this.sqlState); output.writeFieldEnd(); } if (this.errorCode !== null && this.errorCode !== undefined) { @@ -4339,11 +3412,6 @@ TStatus.prototype.write = function(output) { output.writeString(this.errorDetailsJson); output.writeFieldEnd(); } - if (this.responseValidation !== null && this.responseValidation !== undefined) { - output.writeFieldBegin('responseValidation', Thrift.Type.STRING, 3329); - output.writeBinary(this.responseValidation); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -4415,7 +3483,6 @@ TNamespace.prototype.write = function(output) { var THandleIdentifier = module.exports.THandleIdentifier = function(args) { this.guid = null; this.secret = null; - this.executionVersion = null; if (args) { if (args.guid !== undefined && args.guid !== null) { this.guid = args.guid; @@ -4427,9 +3494,6 @@ var THandleIdentifier = module.exports.THandleIdentifier = function(args) { } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field secret is unset!'); } - if (args.executionVersion !== undefined && args.executionVersion !== null) { - this.executionVersion = args.executionVersion; - } } }; THandleIdentifier.prototype = {}; @@ -4457,13 +3521,6 @@ THandleIdentifier.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.I16) { - this.executionVersion = input.readI16(); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -4485,11 +3542,6 @@ THandleIdentifier.prototype.write = function(output) { output.writeBinary(this.secret); output.writeFieldEnd(); } - if (this.executionVersion !== null && this.executionVersion !== undefined) { - output.writeFieldBegin('executionVersion', Thrift.Type.I16, 3329); - output.writeI16(this.executionVersion); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -4497,16 +3549,12 @@ THandleIdentifier.prototype.write = function(output) { var TSessionHandle = module.exports.TSessionHandle = function(args) { this.sessionId = null; - this.serverProtocolVersion = null; if (args) { if (args.sessionId !== undefined && args.sessionId !== null) { this.sessionId = new ttypes.THandleIdentifier(args.sessionId); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); } - if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { - this.serverProtocolVersion = args.serverProtocolVersion; - } } }; TSessionHandle.prototype = {}; @@ -4528,13 +3576,9 @@ TSessionHandle.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.I32) { - this.serverProtocolVersion = input.readI32(); - } else { + case 0: input.skip(ftype); - } - break; + break; default: input.skip(ftype); } @@ -4551,11 +3595,6 @@ TSessionHandle.prototype.write = function(output) { this.sessionId.write(output); output.writeFieldEnd(); } - if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { - output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 3329); - output.writeI32(this.serverProtocolVersion); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -4673,7 +3712,6 @@ var TOpenSessionReq = module.exports.TOpenSessionReq = function(args) { this.connectionProperties = null; this.initialNamespace = null; this.canUseMultipleCatalogs = null; - this.sessionId = null; if (args) { if (args.client_protocol !== undefined && args.client_protocol !== null) { this.client_protocol = args.client_protocol; @@ -4702,9 +3740,6 @@ var TOpenSessionReq = module.exports.TOpenSessionReq = function(args) { if (args.canUseMultipleCatalogs !== undefined && args.canUseMultipleCatalogs !== null) { this.canUseMultipleCatalogs = args.canUseMultipleCatalogs; } - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = new ttypes.THandleIdentifier(args.sessionId); - } } }; TOpenSessionReq.prototype = {}; @@ -4742,14 +3777,14 @@ TOpenSessionReq.prototype.read = function(input) { case 4: if (ftype == Thrift.Type.MAP) { this.configuration = {}; - var _rtmp3152 = input.readMapBegin(); - var _size151 = _rtmp3152.size || 0; - for (var _i153 = 0; _i153 < _size151; ++_i153) { - var key154 = null; - var val155 = null; - key154 = input.readString(); - val155 = input.readString(); - this.configuration[key154] = val155; + var _rtmp3109 = input.readMapBegin(); + var _size108 = _rtmp3109.size || 0; + for (var _i110 = 0; _i110 < _size108; ++_i110) { + var key111 = null; + var val112 = null; + key111 = input.readString(); + val112 = input.readString(); + this.configuration[key111] = val112; } input.readMapEnd(); } else { @@ -4759,12 +3794,12 @@ TOpenSessionReq.prototype.read = function(input) { case 1281: if (ftype == Thrift.Type.LIST) { this.getInfos = []; - var _rtmp3157 = input.readListBegin(); - var _size156 = _rtmp3157.size || 0; - for (var _i158 = 0; _i158 < _size156; ++_i158) { - var elem159 = null; - elem159 = input.readI32(); - this.getInfos.push(elem159); + var _rtmp3114 = input.readListBegin(); + var _size113 = _rtmp3114.size || 0; + for (var _i115 = 0; _i115 < _size113; ++_i115) { + var elem116 = null; + elem116 = input.readI32(); + this.getInfos.push(elem116); } input.readListEnd(); } else { @@ -4781,14 +3816,14 @@ TOpenSessionReq.prototype.read = function(input) { case 1283: if (ftype == Thrift.Type.MAP) { this.connectionProperties = {}; - var _rtmp3161 = input.readMapBegin(); - var _size160 = _rtmp3161.size || 0; - for (var _i162 = 0; _i162 < _size160; ++_i162) { - var key163 = null; - var val164 = null; - key163 = input.readString(); - val164 = input.readString(); - this.connectionProperties[key163] = val164; + var _rtmp3118 = input.readMapBegin(); + var _size117 = _rtmp3118.size || 0; + for (var _i119 = 0; _i119 < _size117; ++_i119) { + var key120 = null; + var val121 = null; + key120 = input.readString(); + val121 = input.readString(); + this.connectionProperties[key120] = val121; } input.readMapEnd(); } else { @@ -4810,14 +3845,6 @@ TOpenSessionReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.sessionId = new ttypes.THandleIdentifier(); - this.sessionId.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -4847,11 +3874,11 @@ TOpenSessionReq.prototype.write = function(output) { if (this.configuration !== null && this.configuration !== undefined) { output.writeFieldBegin('configuration', Thrift.Type.MAP, 4); output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); - for (var kiter165 in this.configuration) { - if (this.configuration.hasOwnProperty(kiter165)) { - var viter166 = this.configuration[kiter165]; - output.writeString(kiter165); - output.writeString(viter166); + for (var kiter122 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter122)) { + var viter123 = this.configuration[kiter122]; + output.writeString(kiter122); + output.writeString(viter123); } } output.writeMapEnd(); @@ -4860,10 +3887,10 @@ TOpenSessionReq.prototype.write = function(output) { if (this.getInfos !== null && this.getInfos !== undefined) { output.writeFieldBegin('getInfos', Thrift.Type.LIST, 1281); output.writeListBegin(Thrift.Type.I32, this.getInfos.length); - for (var iter167 in this.getInfos) { - if (this.getInfos.hasOwnProperty(iter167)) { - iter167 = this.getInfos[iter167]; - output.writeI32(iter167); + for (var iter124 in this.getInfos) { + if (this.getInfos.hasOwnProperty(iter124)) { + iter124 = this.getInfos[iter124]; + output.writeI32(iter124); } } output.writeListEnd(); @@ -4877,11 +3904,11 @@ TOpenSessionReq.prototype.write = function(output) { if (this.connectionProperties !== null && this.connectionProperties !== undefined) { output.writeFieldBegin('connectionProperties', Thrift.Type.MAP, 1283); output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.connectionProperties)); - for (var kiter168 in this.connectionProperties) { - if (this.connectionProperties.hasOwnProperty(kiter168)) { - var viter169 = this.connectionProperties[kiter168]; - output.writeString(kiter168); - output.writeString(viter169); + for (var kiter125 in this.connectionProperties) { + if (this.connectionProperties.hasOwnProperty(kiter125)) { + var viter126 = this.connectionProperties[kiter125]; + output.writeString(kiter125); + output.writeString(viter126); } } output.writeMapEnd(); @@ -4897,11 +3924,6 @@ TOpenSessionReq.prototype.write = function(output) { output.writeBool(this.canUseMultipleCatalogs); output.writeFieldEnd(); } - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 3329); - this.sessionId.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -4980,14 +4002,14 @@ TOpenSessionResp.prototype.read = function(input) { case 4: if (ftype == Thrift.Type.MAP) { this.configuration = {}; - var _rtmp3171 = input.readMapBegin(); - var _size170 = _rtmp3171.size || 0; - for (var _i172 = 0; _i172 < _size170; ++_i172) { - var key173 = null; - var val174 = null; - key173 = input.readString(); - val174 = input.readString(); - this.configuration[key173] = val174; + var _rtmp3128 = input.readMapBegin(); + var _size127 = _rtmp3128.size || 0; + for (var _i129 = 0; _i129 < _size127; ++_i129) { + var key130 = null; + var val131 = null; + key130 = input.readString(); + val131 = input.readString(); + this.configuration[key130] = val131; } input.readMapEnd(); } else { @@ -5012,13 +4034,13 @@ TOpenSessionResp.prototype.read = function(input) { case 1281: if (ftype == Thrift.Type.LIST) { this.getInfos = []; - var _rtmp3176 = input.readListBegin(); - var _size175 = _rtmp3176.size || 0; - for (var _i177 = 0; _i177 < _size175; ++_i177) { - var elem178 = null; - elem178 = new ttypes.TGetInfoValue(); - elem178.read(input); - this.getInfos.push(elem178); + var _rtmp3133 = input.readListBegin(); + var _size132 = _rtmp3133.size || 0; + for (var _i134 = 0; _i134 < _size132; ++_i134) { + var elem135 = null; + elem135 = new ttypes.TGetInfoValue(); + elem135.read(input); + this.getInfos.push(elem135); } input.readListEnd(); } else { @@ -5054,11 +4076,11 @@ TOpenSessionResp.prototype.write = function(output) { if (this.configuration !== null && this.configuration !== undefined) { output.writeFieldBegin('configuration', Thrift.Type.MAP, 4); output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); - for (var kiter179 in this.configuration) { - if (this.configuration.hasOwnProperty(kiter179)) { - var viter180 = this.configuration[kiter179]; - output.writeString(kiter179); - output.writeString(viter180); + for (var kiter136 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter136)) { + var viter137 = this.configuration[kiter136]; + output.writeString(kiter136); + output.writeString(viter137); } } output.writeMapEnd(); @@ -5077,10 +4099,10 @@ TOpenSessionResp.prototype.write = function(output) { if (this.getInfos !== null && this.getInfos !== undefined) { output.writeFieldBegin('getInfos', Thrift.Type.LIST, 1281); output.writeListBegin(Thrift.Type.STRUCT, this.getInfos.length); - for (var iter181 in this.getInfos) { - if (this.getInfos.hasOwnProperty(iter181)) { - iter181 = this.getInfos[iter181]; - iter181.write(output); + for (var iter138 in this.getInfos) { + if (this.getInfos.hasOwnProperty(iter138)) { + iter138 = this.getInfos[iter138]; + iter138.write(output); } } output.writeListEnd(); @@ -5327,7 +4349,6 @@ TGetInfoValue.prototype.write = function(output) { var TGetInfoReq = module.exports.TGetInfoReq = function(args) { this.sessionHandle = null; this.infoType = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -5339,9 +4360,6 @@ var TGetInfoReq = module.exports.TGetInfoReq = function(args) { } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field infoType is unset!'); } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetInfoReq.prototype = {}; @@ -5370,14 +4388,6 @@ TGetInfoReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -5399,11 +4409,6 @@ TGetInfoReq.prototype.write = function(output) { output.writeI32(this.infoType); output.writeFieldEnd(); } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3329); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -5769,27 +4774,6 @@ var TExecuteStatementReq = module.exports.TExecuteStatementReq = function(args) this.parameters = null; this.maxBytesPerBatch = null; this.statementConf = null; - this.operationId = null; - this.sessionConf = null; - this.rejectHighCostQueries = null; - this.estimatedCost = null; - this.executionVersion = null; - this.requestValidation = null; - this.resultPersistenceMode = null; - this.trimArrowBatchesToLimit = null; - this.fetchDisposition = null; - this.enforceResultPersistenceMode = null; - this.statementList = null; - this.persistResultManifest = null; - this.resultRetentionSeconds = null; - this.resultByteLimit = null; - this.resultDataFormat = null; - this.originatingClientIdentity = null; - this.preferSingleFileResult = null; - this.preferDriverOnlyUpload = null; - this.enforceEmbeddedSchemaCorrectness = false; - this.idempotencyToken = null; - this.throwErrorOnByteLimitTruncation = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -5840,365 +4824,143 @@ var TExecuteStatementReq = module.exports.TExecuteStatementReq = function(args) if (args.statementConf !== undefined && args.statementConf !== null) { this.statementConf = new ttypes.TStatementConf(args.statementConf); } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } - if (args.rejectHighCostQueries !== undefined && args.rejectHighCostQueries !== null) { - this.rejectHighCostQueries = args.rejectHighCostQueries; - } - if (args.estimatedCost !== undefined && args.estimatedCost !== null) { - this.estimatedCost = args.estimatedCost; - } - if (args.executionVersion !== undefined && args.executionVersion !== null) { - this.executionVersion = args.executionVersion; - } - if (args.requestValidation !== undefined && args.requestValidation !== null) { - this.requestValidation = args.requestValidation; - } - if (args.resultPersistenceMode !== undefined && args.resultPersistenceMode !== null) { - this.resultPersistenceMode = args.resultPersistenceMode; - } - if (args.trimArrowBatchesToLimit !== undefined && args.trimArrowBatchesToLimit !== null) { - this.trimArrowBatchesToLimit = args.trimArrowBatchesToLimit; - } - if (args.fetchDisposition !== undefined && args.fetchDisposition !== null) { - this.fetchDisposition = args.fetchDisposition; - } - if (args.enforceResultPersistenceMode !== undefined && args.enforceResultPersistenceMode !== null) { - this.enforceResultPersistenceMode = args.enforceResultPersistenceMode; - } - if (args.statementList !== undefined && args.statementList !== null) { - this.statementList = Thrift.copyList(args.statementList, [null]); - } - if (args.persistResultManifest !== undefined && args.persistResultManifest !== null) { - this.persistResultManifest = args.persistResultManifest; - } - if (args.resultRetentionSeconds !== undefined && args.resultRetentionSeconds !== null) { - this.resultRetentionSeconds = args.resultRetentionSeconds; - } - if (args.resultByteLimit !== undefined && args.resultByteLimit !== null) { - this.resultByteLimit = args.resultByteLimit; - } - if (args.resultDataFormat !== undefined && args.resultDataFormat !== null) { - this.resultDataFormat = new ttypes.TDBSqlResultFormat(args.resultDataFormat); - } - if (args.originatingClientIdentity !== undefined && args.originatingClientIdentity !== null) { - this.originatingClientIdentity = args.originatingClientIdentity; - } - if (args.preferSingleFileResult !== undefined && args.preferSingleFileResult !== null) { - this.preferSingleFileResult = args.preferSingleFileResult; - } - if (args.preferDriverOnlyUpload !== undefined && args.preferDriverOnlyUpload !== null) { - this.preferDriverOnlyUpload = args.preferDriverOnlyUpload; - } - if (args.enforceEmbeddedSchemaCorrectness !== undefined && args.enforceEmbeddedSchemaCorrectness !== null) { - this.enforceEmbeddedSchemaCorrectness = args.enforceEmbeddedSchemaCorrectness; - } - if (args.idempotencyToken !== undefined && args.idempotencyToken !== null) { - this.idempotencyToken = args.idempotencyToken; - } - if (args.throwErrorOnByteLimitTruncation !== undefined && args.throwErrorOnByteLimitTruncation !== null) { - this.throwErrorOnByteLimitTruncation = args.throwErrorOnByteLimitTruncation; - } } -}; -TExecuteStatementReq.prototype = {}; -TExecuteStatementReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.sessionHandle = new ttypes.TSessionHandle(); - this.sessionHandle.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.statement = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.MAP) { - this.confOverlay = {}; - var _rtmp3183 = input.readMapBegin(); - var _size182 = _rtmp3183.size || 0; - for (var _i184 = 0; _i184 < _size182; ++_i184) { - var key185 = null; - var val186 = null; - key185 = input.readString(); - val186 = input.readString(); - this.confOverlay[key185] = val186; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.BOOL) { - this.runAsync = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 1281: - if (ftype == Thrift.Type.STRUCT) { - this.getDirectResults = new ttypes.TSparkGetDirectResults(); - this.getDirectResults.read(input); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.queryTimeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 1282: - if (ftype == Thrift.Type.BOOL) { - this.canReadArrowResult = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 1283: - if (ftype == Thrift.Type.BOOL) { - this.canDownloadResult = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 1284: - if (ftype == Thrift.Type.BOOL) { - this.canDecompressLZ4Result = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 1285: - if (ftype == Thrift.Type.I64) { - this.maxBytesPerFile = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 1286: - if (ftype == Thrift.Type.STRUCT) { - this.useArrowNativeTypes = new ttypes.TSparkArrowTypes(); - this.useArrowNativeTypes.read(input); - } else { - input.skip(ftype); - } - break; - case 1287: - if (ftype == Thrift.Type.I64) { - this.resultRowLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 1288: - if (ftype == Thrift.Type.LIST) { - this.parameters = []; - var _rtmp3188 = input.readListBegin(); - var _size187 = _rtmp3188.size || 0; - for (var _i189 = 0; _i189 < _size187; ++_i189) { - var elem190 = null; - elem190 = new ttypes.TSparkParameter(); - elem190.read(input); - this.parameters.push(elem190); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 1289: - if (ftype == Thrift.Type.I64) { - this.maxBytesPerBatch = input.readI64(); - } else { - input.skip(ftype); - } +}; +TExecuteStatementReq.prototype = {}; +TExecuteStatementReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { break; - case 1296: + } + switch (fid) { + case 1: if (ftype == Thrift.Type.STRUCT) { - this.statementConf = new ttypes.TStatementConf(); - this.statementConf.read(input); + this.sessionHandle = new ttypes.TSessionHandle(); + this.sessionHandle.read(input); } else { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); } else { input.skip(ftype); } break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); + case 3: + if (ftype == Thrift.Type.MAP) { + this.confOverlay = {}; + var _rtmp3140 = input.readMapBegin(); + var _size139 = _rtmp3140.size || 0; + for (var _i141 = 0; _i141 < _size139; ++_i141) { + var key142 = null; + var val143 = null; + key142 = input.readString(); + val143 = input.readString(); + this.confOverlay[key142] = val143; + } + input.readMapEnd(); } else { input.skip(ftype); } break; - case 3331: + case 4: if (ftype == Thrift.Type.BOOL) { - this.rejectHighCostQueries = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3332: - if (ftype == Thrift.Type.DOUBLE) { - this.estimatedCost = input.readDouble(); - } else { - input.skip(ftype); - } - break; - case 3333: - if (ftype == Thrift.Type.I16) { - this.executionVersion = input.readI16(); + this.runAsync = input.readBool(); } else { input.skip(ftype); } break; - case 3334: - if (ftype == Thrift.Type.STRING) { - this.requestValidation = input.readBinary(); + case 1281: + if (ftype == Thrift.Type.STRUCT) { + this.getDirectResults = new ttypes.TSparkGetDirectResults(); + this.getDirectResults.read(input); } else { input.skip(ftype); } break; - case 3335: - if (ftype == Thrift.Type.I32) { - this.resultPersistenceMode = input.readI32(); + case 5: + if (ftype == Thrift.Type.I64) { + this.queryTimeout = input.readI64(); } else { input.skip(ftype); } break; - case 3336: + case 1282: if (ftype == Thrift.Type.BOOL) { - this.trimArrowBatchesToLimit = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3337: - if (ftype == Thrift.Type.I32) { - this.fetchDisposition = input.readI32(); + this.canReadArrowResult = input.readBool(); } else { input.skip(ftype); } break; - case 3344: + case 1283: if (ftype == Thrift.Type.BOOL) { - this.enforceResultPersistenceMode = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3345: - if (ftype == Thrift.Type.LIST) { - this.statementList = []; - var _rtmp3192 = input.readListBegin(); - var _size191 = _rtmp3192.size || 0; - for (var _i193 = 0; _i193 < _size191; ++_i193) { - var elem194 = null; - elem194 = new ttypes.TDBSqlStatement(); - elem194.read(input); - this.statementList.push(elem194); - } - input.readListEnd(); + this.canDownloadResult = input.readBool(); } else { input.skip(ftype); } break; - case 3346: + case 1284: if (ftype == Thrift.Type.BOOL) { - this.persistResultManifest = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3347: - if (ftype == Thrift.Type.I64) { - this.resultRetentionSeconds = input.readI64(); + this.canDecompressLZ4Result = input.readBool(); } else { input.skip(ftype); } break; - case 3348: + case 1285: if (ftype == Thrift.Type.I64) { - this.resultByteLimit = input.readI64(); + this.maxBytesPerFile = input.readI64(); } else { input.skip(ftype); } break; - case 3349: + case 1286: if (ftype == Thrift.Type.STRUCT) { - this.resultDataFormat = new ttypes.TDBSqlResultFormat(); - this.resultDataFormat.read(input); - } else { - input.skip(ftype); - } - break; - case 3350: - if (ftype == Thrift.Type.STRING) { - this.originatingClientIdentity = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3351: - if (ftype == Thrift.Type.BOOL) { - this.preferSingleFileResult = input.readBool(); + this.useArrowNativeTypes = new ttypes.TSparkArrowTypes(); + this.useArrowNativeTypes.read(input); } else { input.skip(ftype); } break; - case 3352: - if (ftype == Thrift.Type.BOOL) { - this.preferDriverOnlyUpload = input.readBool(); + case 1287: + if (ftype == Thrift.Type.I64) { + this.resultRowLimit = input.readI64(); } else { input.skip(ftype); } break; - case 3353: - if (ftype == Thrift.Type.BOOL) { - this.enforceEmbeddedSchemaCorrectness = input.readBool(); + case 1288: + if (ftype == Thrift.Type.LIST) { + this.parameters = []; + var _rtmp3145 = input.readListBegin(); + var _size144 = _rtmp3145.size || 0; + for (var _i146 = 0; _i146 < _size144; ++_i146) { + var elem147 = null; + elem147 = new ttypes.TSparkParameter(); + elem147.read(input); + this.parameters.push(elem147); + } + input.readListEnd(); } else { input.skip(ftype); } break; - case 3360: - if (ftype == Thrift.Type.STRING) { - this.idempotencyToken = input.readString(); + case 1289: + if (ftype == Thrift.Type.I64) { + this.maxBytesPerBatch = input.readI64(); } else { input.skip(ftype); } break; - case 3361: - if (ftype == Thrift.Type.BOOL) { - this.throwErrorOnByteLimitTruncation = input.readBool(); + case 1296: + if (ftype == Thrift.Type.STRUCT) { + this.statementConf = new ttypes.TStatementConf(); + this.statementConf.read(input); } else { input.skip(ftype); } @@ -6227,11 +4989,11 @@ TExecuteStatementReq.prototype.write = function(output) { if (this.confOverlay !== null && this.confOverlay !== undefined) { output.writeFieldBegin('confOverlay', Thrift.Type.MAP, 3); output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.confOverlay)); - for (var kiter195 in this.confOverlay) { - if (this.confOverlay.hasOwnProperty(kiter195)) { - var viter196 = this.confOverlay[kiter195]; - output.writeString(kiter195); - output.writeString(viter196); + for (var kiter148 in this.confOverlay) { + if (this.confOverlay.hasOwnProperty(kiter148)) { + var viter149 = this.confOverlay[kiter148]; + output.writeString(kiter148); + output.writeString(viter149); } } output.writeMapEnd(); @@ -6285,10 +5047,10 @@ TExecuteStatementReq.prototype.write = function(output) { if (this.parameters !== null && this.parameters !== undefined) { output.writeFieldBegin('parameters', Thrift.Type.LIST, 1288); output.writeListBegin(Thrift.Type.STRUCT, this.parameters.length); - for (var iter197 in this.parameters) { - if (this.parameters.hasOwnProperty(iter197)) { - iter197 = this.parameters[iter197]; - iter197.write(output); + for (var iter150 in this.parameters) { + if (this.parameters.hasOwnProperty(iter150)) { + iter150 = this.parameters[iter150]; + iter150.write(output); } } output.writeListEnd(); @@ -6304,133 +5066,29 @@ TExecuteStatementReq.prototype.write = function(output) { this.statementConf.write(output); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } - if (this.rejectHighCostQueries !== null && this.rejectHighCostQueries !== undefined) { - output.writeFieldBegin('rejectHighCostQueries', Thrift.Type.BOOL, 3331); - output.writeBool(this.rejectHighCostQueries); - output.writeFieldEnd(); - } - if (this.estimatedCost !== null && this.estimatedCost !== undefined) { - output.writeFieldBegin('estimatedCost', Thrift.Type.DOUBLE, 3332); - output.writeDouble(this.estimatedCost); - output.writeFieldEnd(); - } - if (this.executionVersion !== null && this.executionVersion !== undefined) { - output.writeFieldBegin('executionVersion', Thrift.Type.I16, 3333); - output.writeI16(this.executionVersion); - output.writeFieldEnd(); - } - if (this.requestValidation !== null && this.requestValidation !== undefined) { - output.writeFieldBegin('requestValidation', Thrift.Type.STRING, 3334); - output.writeBinary(this.requestValidation); - output.writeFieldEnd(); - } - if (this.resultPersistenceMode !== null && this.resultPersistenceMode !== undefined) { - output.writeFieldBegin('resultPersistenceMode', Thrift.Type.I32, 3335); - output.writeI32(this.resultPersistenceMode); - output.writeFieldEnd(); - } - if (this.trimArrowBatchesToLimit !== null && this.trimArrowBatchesToLimit !== undefined) { - output.writeFieldBegin('trimArrowBatchesToLimit', Thrift.Type.BOOL, 3336); - output.writeBool(this.trimArrowBatchesToLimit); - output.writeFieldEnd(); - } - if (this.fetchDisposition !== null && this.fetchDisposition !== undefined) { - output.writeFieldBegin('fetchDisposition', Thrift.Type.I32, 3337); - output.writeI32(this.fetchDisposition); - output.writeFieldEnd(); - } - if (this.enforceResultPersistenceMode !== null && this.enforceResultPersistenceMode !== undefined) { - output.writeFieldBegin('enforceResultPersistenceMode', Thrift.Type.BOOL, 3344); - output.writeBool(this.enforceResultPersistenceMode); - output.writeFieldEnd(); - } - if (this.statementList !== null && this.statementList !== undefined) { - output.writeFieldBegin('statementList', Thrift.Type.LIST, 3345); - output.writeListBegin(Thrift.Type.STRUCT, this.statementList.length); - for (var iter198 in this.statementList) { - if (this.statementList.hasOwnProperty(iter198)) { - iter198 = this.statementList[iter198]; - iter198.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.persistResultManifest !== null && this.persistResultManifest !== undefined) { - output.writeFieldBegin('persistResultManifest', Thrift.Type.BOOL, 3346); - output.writeBool(this.persistResultManifest); - output.writeFieldEnd(); - } - if (this.resultRetentionSeconds !== null && this.resultRetentionSeconds !== undefined) { - output.writeFieldBegin('resultRetentionSeconds', Thrift.Type.I64, 3347); - output.writeI64(this.resultRetentionSeconds); - output.writeFieldEnd(); - } - if (this.resultByteLimit !== null && this.resultByteLimit !== undefined) { - output.writeFieldBegin('resultByteLimit', Thrift.Type.I64, 3348); - output.writeI64(this.resultByteLimit); - output.writeFieldEnd(); - } - if (this.resultDataFormat !== null && this.resultDataFormat !== undefined) { - output.writeFieldBegin('resultDataFormat', Thrift.Type.STRUCT, 3349); - this.resultDataFormat.write(output); - output.writeFieldEnd(); - } - if (this.originatingClientIdentity !== null && this.originatingClientIdentity !== undefined) { - output.writeFieldBegin('originatingClientIdentity', Thrift.Type.STRING, 3350); - output.writeString(this.originatingClientIdentity); - output.writeFieldEnd(); - } - if (this.preferSingleFileResult !== null && this.preferSingleFileResult !== undefined) { - output.writeFieldBegin('preferSingleFileResult', Thrift.Type.BOOL, 3351); - output.writeBool(this.preferSingleFileResult); - output.writeFieldEnd(); - } - if (this.preferDriverOnlyUpload !== null && this.preferDriverOnlyUpload !== undefined) { - output.writeFieldBegin('preferDriverOnlyUpload', Thrift.Type.BOOL, 3352); - output.writeBool(this.preferDriverOnlyUpload); - output.writeFieldEnd(); - } - if (this.enforceEmbeddedSchemaCorrectness !== null && this.enforceEmbeddedSchemaCorrectness !== undefined) { - output.writeFieldBegin('enforceEmbeddedSchemaCorrectness', Thrift.Type.BOOL, 3353); - output.writeBool(this.enforceEmbeddedSchemaCorrectness); - output.writeFieldEnd(); - } - if (this.idempotencyToken !== null && this.idempotencyToken !== undefined) { - output.writeFieldBegin('idempotencyToken', Thrift.Type.STRING, 3360); - output.writeString(this.idempotencyToken); - output.writeFieldEnd(); - } - if (this.throwErrorOnByteLimitTruncation !== null && this.throwErrorOnByteLimitTruncation !== undefined) { - output.writeFieldBegin('throwErrorOnByteLimitTruncation', Thrift.Type.BOOL, 3361); - output.writeBool(this.throwErrorOnByteLimitTruncation); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; }; -var TDBSqlStatement = module.exports.TDBSqlStatement = function(args) { - this.statement = null; +var TSparkParameterValue = module.exports.TSparkParameterValue = function(args) { + this.stringValue = null; + this.doubleValue = null; + this.booleanValue = null; if (args) { - if (args.statement !== undefined && args.statement !== null) { - this.statement = args.statement; + if (args.stringValue !== undefined && args.stringValue !== null) { + this.stringValue = args.stringValue; + } + if (args.doubleValue !== undefined && args.doubleValue !== null) { + this.doubleValue = args.doubleValue; + } + if (args.booleanValue !== undefined && args.booleanValue !== null) { + this.booleanValue = args.booleanValue; } } }; -TDBSqlStatement.prototype = {}; -TDBSqlStatement.prototype.read = function(input) { +TSparkParameterValue.prototype = {}; +TSparkParameterValue.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -6442,14 +5100,25 @@ TDBSqlStatement.prototype.read = function(input) { switch (fid) { case 1: if (ftype == Thrift.Type.STRING) { - this.statement = input.readString(); + this.stringValue = input.readString(); } else { input.skip(ftype); } break; - case 0: + case 2: + if (ftype == Thrift.Type.DOUBLE) { + this.doubleValue = input.readDouble(); + } else { input.skip(ftype); - break; + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.booleanValue = input.readBool(); + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -6459,11 +5128,21 @@ TDBSqlStatement.prototype.read = function(input) { return; }; -TDBSqlStatement.prototype.write = function(output) { - output.writeStructBegin('TDBSqlStatement'); - if (this.statement !== null && this.statement !== undefined) { - output.writeFieldBegin('statement', Thrift.Type.STRING, 1); - output.writeString(this.statement); +TSparkParameterValue.prototype.write = function(output) { + output.writeStructBegin('TSparkParameterValue'); + if (this.stringValue !== null && this.stringValue !== undefined) { + output.writeFieldBegin('stringValue', Thrift.Type.STRING, 1); + output.writeString(this.stringValue); + output.writeFieldEnd(); + } + if (this.doubleValue !== null && this.doubleValue !== undefined) { + output.writeFieldBegin('doubleValue', Thrift.Type.DOUBLE, 2); + output.writeDouble(this.doubleValue); + output.writeFieldEnd(); + } + if (this.booleanValue !== null && this.booleanValue !== undefined) { + output.writeFieldBegin('booleanValue', Thrift.Type.BOOL, 3); + output.writeBool(this.booleanValue); output.writeFieldEnd(); } output.writeFieldStop(); @@ -6471,24 +5150,24 @@ TDBSqlStatement.prototype.write = function(output) { return; }; -var TSparkParameterValue = module.exports.TSparkParameterValue = function(args) { - this.stringValue = null; - this.doubleValue = null; - this.booleanValue = null; +var TSparkParameterValueArg = module.exports.TSparkParameterValueArg = function(args) { + this.type = null; + this.value = null; + this.arguments = null; if (args) { - if (args.stringValue !== undefined && args.stringValue !== null) { - this.stringValue = args.stringValue; + if (args.type !== undefined && args.type !== null) { + this.type = args.type; } - if (args.doubleValue !== undefined && args.doubleValue !== null) { - this.doubleValue = args.doubleValue; + if (args.value !== undefined && args.value !== null) { + this.value = args.value; } - if (args.booleanValue !== undefined && args.booleanValue !== null) { - this.booleanValue = args.booleanValue; + if (args.arguments !== undefined && args.arguments !== null) { + this.arguments = Thrift.copyList(args.arguments, [null]); } } }; -TSparkParameterValue.prototype = {}; -TSparkParameterValue.prototype.read = function(input) { +TSparkParameterValueArg.prototype = {}; +TSparkParameterValueArg.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -6500,21 +5179,30 @@ TSparkParameterValue.prototype.read = function(input) { switch (fid) { case 1: if (ftype == Thrift.Type.STRING) { - this.stringValue = input.readString(); + this.type = input.readString(); } else { input.skip(ftype); } break; case 2: - if (ftype == Thrift.Type.DOUBLE) { - this.doubleValue = input.readDouble(); + if (ftype == Thrift.Type.STRING) { + this.value = input.readString(); } else { input.skip(ftype); } break; case 3: - if (ftype == Thrift.Type.BOOL) { - this.booleanValue = input.readBool(); + if (ftype == Thrift.Type.LIST) { + this.arguments = []; + var _rtmp3152 = input.readListBegin(); + var _size151 = _rtmp3152.size || 0; + for (var _i153 = 0; _i153 < _size151; ++_i153) { + var elem154 = null; + elem154 = new ttypes.TSparkParameterValueArg(); + elem154.read(input); + this.arguments.push(elem154); + } + input.readListEnd(); } else { input.skip(ftype); } @@ -6528,21 +5216,28 @@ TSparkParameterValue.prototype.read = function(input) { return; }; -TSparkParameterValue.prototype.write = function(output) { - output.writeStructBegin('TSparkParameterValue'); - if (this.stringValue !== null && this.stringValue !== undefined) { - output.writeFieldBegin('stringValue', Thrift.Type.STRING, 1); - output.writeString(this.stringValue); +TSparkParameterValueArg.prototype.write = function(output) { + output.writeStructBegin('TSparkParameterValueArg'); + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.STRING, 1); + output.writeString(this.type); output.writeFieldEnd(); } - if (this.doubleValue !== null && this.doubleValue !== undefined) { - output.writeFieldBegin('doubleValue', Thrift.Type.DOUBLE, 2); - output.writeDouble(this.doubleValue); + if (this.value !== null && this.value !== undefined) { + output.writeFieldBegin('value', Thrift.Type.STRING, 2); + output.writeString(this.value); output.writeFieldEnd(); } - if (this.booleanValue !== null && this.booleanValue !== undefined) { - output.writeFieldBegin('booleanValue', Thrift.Type.BOOL, 3); - output.writeBool(this.booleanValue); + if (this.arguments !== null && this.arguments !== undefined) { + output.writeFieldBegin('arguments', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRUCT, this.arguments.length); + for (var iter155 in this.arguments) { + if (this.arguments.hasOwnProperty(iter155)) { + iter155 = this.arguments[iter155]; + iter155.write(output); + } + } + output.writeListEnd(); output.writeFieldEnd(); } output.writeFieldStop(); @@ -6555,6 +5250,7 @@ var TSparkParameter = module.exports.TSparkParameter = function(args) { this.name = null; this.type = null; this.value = null; + this.arguments = null; if (args) { if (args.ordinal !== undefined && args.ordinal !== null) { this.ordinal = args.ordinal; @@ -6568,6 +5264,9 @@ var TSparkParameter = module.exports.TSparkParameter = function(args) { if (args.value !== undefined && args.value !== null) { this.value = new ttypes.TSparkParameterValue(args.value); } + if (args.arguments !== undefined && args.arguments !== null) { + this.arguments = Thrift.copyList(args.arguments, [ttypes.TSparkParameterValueArg]); + } } }; TSparkParameter.prototype = {}; @@ -6610,6 +5309,22 @@ TSparkParameter.prototype.read = function(input) { input.skip(ftype); } break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.arguments = []; + var _rtmp3157 = input.readListBegin(); + var _size156 = _rtmp3157.size || 0; + for (var _i158 = 0; _i158 < _size156; ++_i158) { + var elem159 = null; + elem159 = new ttypes.TSparkParameterValueArg(); + elem159.read(input); + this.arguments.push(elem159); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; default: input.skip(ftype); } @@ -6641,6 +5356,18 @@ TSparkParameter.prototype.write = function(output) { this.value.write(output); output.writeFieldEnd(); } + if (this.arguments !== null && this.arguments !== undefined) { + output.writeFieldBegin('arguments', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.STRUCT, this.arguments.length); + for (var iter160 in this.arguments) { + if (this.arguments.hasOwnProperty(iter160)) { + iter160 = this.arguments[iter160]; + iter160.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; @@ -6746,15 +5473,6 @@ var TExecuteStatementResp = module.exports.TExecuteStatementResp = function(args this.status = null; this.operationHandle = null; this.directResults = null; - this.executionRejected = null; - this.maxClusterCapacity = null; - this.queryCost = null; - this.sessionConf = null; - this.currentClusterLoad = null; - this.idempotencyType = null; - this.remoteResultCacheEnabled = null; - this.isServerless = null; - this.operationHandles = null; if (args) { if (args.status !== undefined && args.status !== null) { this.status = new ttypes.TStatus(args.status); @@ -6767,33 +5485,6 @@ var TExecuteStatementResp = module.exports.TExecuteStatementResp = function(args if (args.directResults !== undefined && args.directResults !== null) { this.directResults = new ttypes.TSparkDirectResults(args.directResults); } - if (args.executionRejected !== undefined && args.executionRejected !== null) { - this.executionRejected = args.executionRejected; - } - if (args.maxClusterCapacity !== undefined && args.maxClusterCapacity !== null) { - this.maxClusterCapacity = args.maxClusterCapacity; - } - if (args.queryCost !== undefined && args.queryCost !== null) { - this.queryCost = args.queryCost; - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } - if (args.currentClusterLoad !== undefined && args.currentClusterLoad !== null) { - this.currentClusterLoad = args.currentClusterLoad; - } - if (args.idempotencyType !== undefined && args.idempotencyType !== null) { - this.idempotencyType = args.idempotencyType; - } - if (args.remoteResultCacheEnabled !== undefined && args.remoteResultCacheEnabled !== null) { - this.remoteResultCacheEnabled = args.remoteResultCacheEnabled; - } - if (args.isServerless !== undefined && args.isServerless !== null) { - this.isServerless = args.isServerless; - } - if (args.operationHandles !== undefined && args.operationHandles !== null) { - this.operationHandles = Thrift.copyList(args.operationHandles, [ttypes.TOperationHandle]); - } } }; TExecuteStatementResp.prototype = {}; @@ -6831,79 +5522,6 @@ TExecuteStatementResp.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.BOOL) { - this.executionRejected = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.DOUBLE) { - this.maxClusterCapacity = input.readDouble(); - } else { - input.skip(ftype); - } - break; - case 3331: - if (ftype == Thrift.Type.DOUBLE) { - this.queryCost = input.readDouble(); - } else { - input.skip(ftype); - } - break; - case 3332: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; - case 3333: - if (ftype == Thrift.Type.DOUBLE) { - this.currentClusterLoad = input.readDouble(); - } else { - input.skip(ftype); - } - break; - case 3334: - if (ftype == Thrift.Type.I32) { - this.idempotencyType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3335: - if (ftype == Thrift.Type.BOOL) { - this.remoteResultCacheEnabled = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3336: - if (ftype == Thrift.Type.BOOL) { - this.isServerless = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3337: - if (ftype == Thrift.Type.LIST) { - this.operationHandles = []; - var _rtmp3200 = input.readListBegin(); - var _size199 = _rtmp3200.size || 0; - for (var _i201 = 0; _i201 < _size199; ++_i201) { - var elem202 = null; - elem202 = new ttypes.TOperationHandle(); - elem202.read(input); - this.operationHandles.push(elem202); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -6930,58 +5548,6 @@ TExecuteStatementResp.prototype.write = function(output) { this.directResults.write(output); output.writeFieldEnd(); } - if (this.executionRejected !== null && this.executionRejected !== undefined) { - output.writeFieldBegin('executionRejected', Thrift.Type.BOOL, 3329); - output.writeBool(this.executionRejected); - output.writeFieldEnd(); - } - if (this.maxClusterCapacity !== null && this.maxClusterCapacity !== undefined) { - output.writeFieldBegin('maxClusterCapacity', Thrift.Type.DOUBLE, 3330); - output.writeDouble(this.maxClusterCapacity); - output.writeFieldEnd(); - } - if (this.queryCost !== null && this.queryCost !== undefined) { - output.writeFieldBegin('queryCost', Thrift.Type.DOUBLE, 3331); - output.writeDouble(this.queryCost); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3332); - this.sessionConf.write(output); - output.writeFieldEnd(); - } - if (this.currentClusterLoad !== null && this.currentClusterLoad !== undefined) { - output.writeFieldBegin('currentClusterLoad', Thrift.Type.DOUBLE, 3333); - output.writeDouble(this.currentClusterLoad); - output.writeFieldEnd(); - } - if (this.idempotencyType !== null && this.idempotencyType !== undefined) { - output.writeFieldBegin('idempotencyType', Thrift.Type.I32, 3334); - output.writeI32(this.idempotencyType); - output.writeFieldEnd(); - } - if (this.remoteResultCacheEnabled !== null && this.remoteResultCacheEnabled !== undefined) { - output.writeFieldBegin('remoteResultCacheEnabled', Thrift.Type.BOOL, 3335); - output.writeBool(this.remoteResultCacheEnabled); - output.writeFieldEnd(); - } - if (this.isServerless !== null && this.isServerless !== undefined) { - output.writeFieldBegin('isServerless', Thrift.Type.BOOL, 3336); - output.writeBool(this.isServerless); - output.writeFieldEnd(); - } - if (this.operationHandles !== null && this.operationHandles !== undefined) { - output.writeFieldBegin('operationHandles', Thrift.Type.LIST, 3337); - output.writeListBegin(Thrift.Type.STRUCT, this.operationHandles.length); - for (var iter203 in this.operationHandles) { - if (this.operationHandles.hasOwnProperty(iter203)) { - iter203 = this.operationHandles[iter203]; - iter203.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -6991,8 +5557,6 @@ var TGetTypeInfoReq = module.exports.TGetTypeInfoReq = function(args) { this.sessionHandle = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -7005,12 +5569,6 @@ var TGetTypeInfoReq = module.exports.TGetTypeInfoReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetTypeInfoReq.prototype = {}; @@ -7047,22 +5605,6 @@ TGetTypeInfoReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -7089,16 +5631,6 @@ TGetTypeInfoReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -7192,8 +5724,6 @@ var TGetCatalogsReq = module.exports.TGetCatalogsReq = function(args) { this.sessionHandle = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -7206,12 +5736,6 @@ var TGetCatalogsReq = module.exports.TGetCatalogsReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetCatalogsReq.prototype = {}; @@ -7248,22 +5772,6 @@ TGetCatalogsReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -7290,16 +5798,6 @@ TGetCatalogsReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -7395,8 +5893,6 @@ var TGetSchemasReq = module.exports.TGetSchemasReq = function(args) { this.schemaName = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -7415,12 +5911,6 @@ var TGetSchemasReq = module.exports.TGetSchemasReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetSchemasReq.prototype = {}; @@ -7471,22 +5961,6 @@ TGetSchemasReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -7523,16 +5997,6 @@ TGetSchemasReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -7630,8 +6094,6 @@ var TGetTablesReq = module.exports.TGetTablesReq = function(args) { this.tableTypes = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -7656,12 +6118,6 @@ var TGetTablesReq = module.exports.TGetTablesReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetTablesReq.prototype = {}; @@ -7707,12 +6163,12 @@ TGetTablesReq.prototype.read = function(input) { case 5: if (ftype == Thrift.Type.LIST) { this.tableTypes = []; - var _rtmp3205 = input.readListBegin(); - var _size204 = _rtmp3205.size || 0; - for (var _i206 = 0; _i206 < _size204; ++_i206) { - var elem207 = null; - elem207 = input.readString(); - this.tableTypes.push(elem207); + var _rtmp3162 = input.readListBegin(); + var _size161 = _rtmp3162.size || 0; + for (var _i163 = 0; _i163 < _size161; ++_i163) { + var elem164 = null; + elem164 = input.readString(); + this.tableTypes.push(elem164); } input.readListEnd(); } else { @@ -7734,22 +6190,6 @@ TGetTablesReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -7784,10 +6224,10 @@ TGetTablesReq.prototype.write = function(output) { if (this.tableTypes !== null && this.tableTypes !== undefined) { output.writeFieldBegin('tableTypes', Thrift.Type.LIST, 5); output.writeListBegin(Thrift.Type.STRING, this.tableTypes.length); - for (var iter208 in this.tableTypes) { - if (this.tableTypes.hasOwnProperty(iter208)) { - iter208 = this.tableTypes[iter208]; - output.writeString(iter208); + for (var iter165 in this.tableTypes) { + if (this.tableTypes.hasOwnProperty(iter165)) { + iter165 = this.tableTypes[iter165]; + output.writeString(iter165); } } output.writeListEnd(); @@ -7803,16 +6243,6 @@ TGetTablesReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -7906,8 +6336,6 @@ var TGetTableTypesReq = module.exports.TGetTableTypesReq = function(args) { this.sessionHandle = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -7920,12 +6348,6 @@ var TGetTableTypesReq = module.exports.TGetTableTypesReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetTableTypesReq.prototype = {}; @@ -7962,22 +6384,6 @@ TGetTableTypesReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -8004,16 +6410,6 @@ TGetTableTypesReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -8111,8 +6507,6 @@ var TGetColumnsReq = module.exports.TGetColumnsReq = function(args) { this.columnName = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -8137,12 +6531,6 @@ var TGetColumnsReq = module.exports.TGetColumnsReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetColumnsReq.prototype = {}; @@ -8207,22 +6595,6 @@ TGetColumnsReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -8269,16 +6641,6 @@ TGetColumnsReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -8375,8 +6737,6 @@ var TGetFunctionsReq = module.exports.TGetFunctionsReq = function(args) { this.functionName = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -8400,12 +6760,6 @@ var TGetFunctionsReq = module.exports.TGetFunctionsReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetFunctionsReq.prototype = {}; @@ -8457,24 +6811,8 @@ TGetFunctionsReq.prototype.read = function(input) { } break; case 1282: - if (ftype == Thrift.Type.BOOL) { - this.runAsync = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); + if (ftype == Thrift.Type.BOOL) { + this.runAsync = input.readBool(); } else { input.skip(ftype); } @@ -8520,16 +6858,6 @@ TGetFunctionsReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -8626,8 +6954,6 @@ var TGetPrimaryKeysReq = module.exports.TGetPrimaryKeysReq = function(args) { this.tableName = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -8649,12 +6975,6 @@ var TGetPrimaryKeysReq = module.exports.TGetPrimaryKeysReq = function(args) { if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetPrimaryKeysReq.prototype = {}; @@ -8712,22 +7032,6 @@ TGetPrimaryKeysReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -8769,16 +7073,6 @@ TGetPrimaryKeysReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -8878,8 +7172,6 @@ var TGetCrossReferenceReq = module.exports.TGetCrossReferenceReq = function(args this.foreignTableName = null; this.getDirectResults = null; this.runAsync = false; - this.operationId = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -8910,12 +7202,6 @@ var TGetCrossReferenceReq = module.exports.TGetCrossReferenceReq = function(args if (args.runAsync !== undefined && args.runAsync !== null) { this.runAsync = args.runAsync; } - if (args.operationId !== undefined && args.operationId !== null) { - this.operationId = new ttypes.THandleIdentifier(args.operationId); - } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetCrossReferenceReq.prototype = {}; @@ -8994,22 +7280,6 @@ TGetCrossReferenceReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.operationId = new ttypes.THandleIdentifier(); - this.operationId.read(input); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -9066,16 +7336,6 @@ TGetCrossReferenceReq.prototype.write = function(output) { output.writeBool(this.runAsync); output.writeFieldEnd(); } - if (this.operationId !== null && this.operationId !== undefined) { - output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 3329); - this.operationId.write(output); - output.writeFieldEnd(); - } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3330); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -9246,10 +7506,6 @@ var TGetOperationStatusResp = module.exports.TGetOperationStatusResp = function( this.displayMessage = null; this.diagnosticInfo = null; this.errorDetailsJson = null; - this.responseValidation = null; - this.idempotencyType = null; - this.statementTimeout = null; - this.statementTimeoutLevel = null; if (args) { if (args.status !== undefined && args.status !== null) { this.status = new ttypes.TStatus(args.status); @@ -9295,18 +7551,6 @@ var TGetOperationStatusResp = module.exports.TGetOperationStatusResp = function( if (args.errorDetailsJson !== undefined && args.errorDetailsJson !== null) { this.errorDetailsJson = args.errorDetailsJson; } - if (args.responseValidation !== undefined && args.responseValidation !== null) { - this.responseValidation = args.responseValidation; - } - if (args.idempotencyType !== undefined && args.idempotencyType !== null) { - this.idempotencyType = args.idempotencyType; - } - if (args.statementTimeout !== undefined && args.statementTimeout !== null) { - this.statementTimeout = args.statementTimeout; - } - if (args.statementTimeoutLevel !== undefined && args.statementTimeoutLevel !== null) { - this.statementTimeoutLevel = args.statementTimeoutLevel; - } } }; TGetOperationStatusResp.prototype = {}; @@ -9420,34 +7664,6 @@ TGetOperationStatusResp.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRING) { - this.responseValidation = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.I32) { - this.idempotencyType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3331: - if (ftype == Thrift.Type.I64) { - this.statementTimeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3332: - if (ftype == Thrift.Type.I32) { - this.statementTimeoutLevel = input.readI32(); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -9529,26 +7745,6 @@ TGetOperationStatusResp.prototype.write = function(output) { output.writeString(this.errorDetailsJson); output.writeFieldEnd(); } - if (this.responseValidation !== null && this.responseValidation !== undefined) { - output.writeFieldBegin('responseValidation', Thrift.Type.STRING, 3329); - output.writeBinary(this.responseValidation); - output.writeFieldEnd(); - } - if (this.idempotencyType !== null && this.idempotencyType !== undefined) { - output.writeFieldBegin('idempotencyType', Thrift.Type.I32, 3330); - output.writeI32(this.idempotencyType); - output.writeFieldEnd(); - } - if (this.statementTimeout !== null && this.statementTimeout !== undefined) { - output.writeFieldBegin('statementTimeout', Thrift.Type.I64, 3331); - output.writeI64(this.statementTimeout); - output.writeFieldEnd(); - } - if (this.statementTimeoutLevel !== null && this.statementTimeoutLevel !== undefined) { - output.writeFieldBegin('statementTimeoutLevel', Thrift.Type.I32, 3332); - output.writeI32(this.statementTimeoutLevel); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -9556,20 +7752,12 @@ TGetOperationStatusResp.prototype.write = function(output) { var TCancelOperationReq = module.exports.TCancelOperationReq = function(args) { this.operationHandle = null; - this.executionVersion = null; - this.replacedByNextAttempt = null; if (args) { if (args.operationHandle !== undefined && args.operationHandle !== null) { this.operationHandle = new ttypes.TOperationHandle(args.operationHandle); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!'); } - if (args.executionVersion !== undefined && args.executionVersion !== null) { - this.executionVersion = args.executionVersion; - } - if (args.replacedByNextAttempt !== undefined && args.replacedByNextAttempt !== null) { - this.replacedByNextAttempt = args.replacedByNextAttempt; - } } }; TCancelOperationReq.prototype = {}; @@ -9591,20 +7779,9 @@ TCancelOperationReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.I16) { - this.executionVersion = input.readI16(); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.BOOL) { - this.replacedByNextAttempt = input.readBool(); - } else { + case 0: input.skip(ftype); - } - break; + break; default: input.skip(ftype); } @@ -9621,16 +7798,6 @@ TCancelOperationReq.prototype.write = function(output) { this.operationHandle.write(output); output.writeFieldEnd(); } - if (this.executionVersion !== null && this.executionVersion !== undefined) { - output.writeFieldBegin('executionVersion', Thrift.Type.I16, 3329); - output.writeI16(this.executionVersion); - output.writeFieldEnd(); - } - if (this.replacedByNextAttempt !== null && this.replacedByNextAttempt !== undefined) { - output.writeFieldBegin('replacedByNextAttempt', Thrift.Type.BOOL, 3330); - output.writeBool(this.replacedByNextAttempt); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -9691,16 +7858,12 @@ TCancelOperationResp.prototype.write = function(output) { var TCloseOperationReq = module.exports.TCloseOperationReq = function(args) { this.operationHandle = null; - this.closeReason = 0; if (args) { if (args.operationHandle !== undefined && args.operationHandle !== null) { this.operationHandle = new ttypes.TOperationHandle(args.operationHandle); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!'); } - if (args.closeReason !== undefined && args.closeReason !== null) { - this.closeReason = args.closeReason; - } } }; TCloseOperationReq.prototype = {}; @@ -9722,13 +7885,9 @@ TCloseOperationReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.I32) { - this.closeReason = input.readI32(); - } else { + case 0: input.skip(ftype); - } - break; + break; default: input.skip(ftype); } @@ -9745,11 +7904,6 @@ TCloseOperationReq.prototype.write = function(output) { this.operationHandle.write(output); output.writeFieldEnd(); } - if (this.closeReason !== null && this.closeReason !== undefined) { - output.writeFieldBegin('closeReason', Thrift.Type.I32, 3329); - output.writeI32(this.closeReason); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -9810,16 +7964,12 @@ TCloseOperationResp.prototype.write = function(output) { var TGetResultSetMetadataReq = module.exports.TGetResultSetMetadataReq = function(args) { this.operationHandle = null; - this.includeCloudResultFiles = null; if (args) { if (args.operationHandle !== undefined && args.operationHandle !== null) { this.operationHandle = new ttypes.TOperationHandle(args.operationHandle); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!'); } - if (args.includeCloudResultFiles !== undefined && args.includeCloudResultFiles !== null) { - this.includeCloudResultFiles = args.includeCloudResultFiles; - } } }; TGetResultSetMetadataReq.prototype = {}; @@ -9841,13 +7991,9 @@ TGetResultSetMetadataReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.BOOL) { - this.includeCloudResultFiles = input.readBool(); - } else { + case 0: input.skip(ftype); - } - break; + break; default: input.skip(ftype); } @@ -9864,11 +8010,6 @@ TGetResultSetMetadataReq.prototype.write = function(output) { this.operationHandle.write(output); output.writeFieldEnd(); } - if (this.includeCloudResultFiles !== null && this.includeCloudResultFiles !== undefined) { - output.writeFieldBegin('includeCloudResultFiles', Thrift.Type.BOOL, 3329); - output.writeBool(this.includeCloudResultFiles); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -9884,18 +8025,6 @@ var TGetResultSetMetadataResp = module.exports.TGetResultSetMetadataResp = funct this.uncompressedBytes = null; this.compressedBytes = null; this.isStagingOperation = null; - this.reasonForNoCloudFetch = null; - this.resultFiles = null; - this.manifestFile = null; - this.manifestFileFormat = null; - this.cacheLookupLatency = null; - this.remoteCacheMissReason = null; - this.fetchDisposition = null; - this.remoteResultCacheEnabled = null; - this.isServerless = null; - this.resultDataFormat = null; - this.truncatedByThriftLimit = null; - this.resultByteLimit = null; if (args) { if (args.status !== undefined && args.status !== null) { this.status = new ttypes.TStatus(args.status); @@ -9926,42 +8055,6 @@ var TGetResultSetMetadataResp = module.exports.TGetResultSetMetadataResp = funct if (args.isStagingOperation !== undefined && args.isStagingOperation !== null) { this.isStagingOperation = args.isStagingOperation; } - if (args.reasonForNoCloudFetch !== undefined && args.reasonForNoCloudFetch !== null) { - this.reasonForNoCloudFetch = args.reasonForNoCloudFetch; - } - if (args.resultFiles !== undefined && args.resultFiles !== null) { - this.resultFiles = Thrift.copyList(args.resultFiles, [ttypes.TDBSqlCloudResultFile]); - } - if (args.manifestFile !== undefined && args.manifestFile !== null) { - this.manifestFile = args.manifestFile; - } - if (args.manifestFileFormat !== undefined && args.manifestFileFormat !== null) { - this.manifestFileFormat = args.manifestFileFormat; - } - if (args.cacheLookupLatency !== undefined && args.cacheLookupLatency !== null) { - this.cacheLookupLatency = args.cacheLookupLatency; - } - if (args.remoteCacheMissReason !== undefined && args.remoteCacheMissReason !== null) { - this.remoteCacheMissReason = args.remoteCacheMissReason; - } - if (args.fetchDisposition !== undefined && args.fetchDisposition !== null) { - this.fetchDisposition = args.fetchDisposition; - } - if (args.remoteResultCacheEnabled !== undefined && args.remoteResultCacheEnabled !== null) { - this.remoteResultCacheEnabled = args.remoteResultCacheEnabled; - } - if (args.isServerless !== undefined && args.isServerless !== null) { - this.isServerless = args.isServerless; - } - if (args.resultDataFormat !== undefined && args.resultDataFormat !== null) { - this.resultDataFormat = new ttypes.TDBSqlResultFormat(args.resultDataFormat); - } - if (args.truncatedByThriftLimit !== undefined && args.truncatedByThriftLimit !== null) { - this.truncatedByThriftLimit = args.truncatedByThriftLimit; - } - if (args.resultByteLimit !== undefined && args.resultByteLimit !== null) { - this.resultByteLimit = args.resultByteLimit; - } } }; TGetResultSetMetadataResp.prototype = {}; @@ -10040,100 +8133,6 @@ TGetResultSetMetadataResp.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.I32) { - this.reasonForNoCloudFetch = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3330: - if (ftype == Thrift.Type.LIST) { - this.resultFiles = []; - var _rtmp3210 = input.readListBegin(); - var _size209 = _rtmp3210.size || 0; - for (var _i211 = 0; _i211 < _size209; ++_i211) { - var elem212 = null; - elem212 = new ttypes.TDBSqlCloudResultFile(); - elem212.read(input); - this.resultFiles.push(elem212); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3331: - if (ftype == Thrift.Type.STRING) { - this.manifestFile = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3332: - if (ftype == Thrift.Type.I32) { - this.manifestFileFormat = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3333: - if (ftype == Thrift.Type.I64) { - this.cacheLookupLatency = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3334: - if (ftype == Thrift.Type.STRING) { - this.remoteCacheMissReason = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3335: - if (ftype == Thrift.Type.I32) { - this.fetchDisposition = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3336: - if (ftype == Thrift.Type.BOOL) { - this.remoteResultCacheEnabled = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3337: - if (ftype == Thrift.Type.BOOL) { - this.isServerless = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3344: - if (ftype == Thrift.Type.STRUCT) { - this.resultDataFormat = new ttypes.TDBSqlResultFormat(); - this.resultDataFormat.read(input); - } else { - input.skip(ftype); - } - break; - case 3345: - if (ftype == Thrift.Type.BOOL) { - this.truncatedByThriftLimit = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3346: - if (ftype == Thrift.Type.I64) { - this.resultByteLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -10190,73 +8189,6 @@ TGetResultSetMetadataResp.prototype.write = function(output) { output.writeBool(this.isStagingOperation); output.writeFieldEnd(); } - if (this.reasonForNoCloudFetch !== null && this.reasonForNoCloudFetch !== undefined) { - output.writeFieldBegin('reasonForNoCloudFetch', Thrift.Type.I32, 3329); - output.writeI32(this.reasonForNoCloudFetch); - output.writeFieldEnd(); - } - if (this.resultFiles !== null && this.resultFiles !== undefined) { - output.writeFieldBegin('resultFiles', Thrift.Type.LIST, 3330); - output.writeListBegin(Thrift.Type.STRUCT, this.resultFiles.length); - for (var iter213 in this.resultFiles) { - if (this.resultFiles.hasOwnProperty(iter213)) { - iter213 = this.resultFiles[iter213]; - iter213.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.manifestFile !== null && this.manifestFile !== undefined) { - output.writeFieldBegin('manifestFile', Thrift.Type.STRING, 3331); - output.writeString(this.manifestFile); - output.writeFieldEnd(); - } - if (this.manifestFileFormat !== null && this.manifestFileFormat !== undefined) { - output.writeFieldBegin('manifestFileFormat', Thrift.Type.I32, 3332); - output.writeI32(this.manifestFileFormat); - output.writeFieldEnd(); - } - if (this.cacheLookupLatency !== null && this.cacheLookupLatency !== undefined) { - output.writeFieldBegin('cacheLookupLatency', Thrift.Type.I64, 3333); - output.writeI64(this.cacheLookupLatency); - output.writeFieldEnd(); - } - if (this.remoteCacheMissReason !== null && this.remoteCacheMissReason !== undefined) { - output.writeFieldBegin('remoteCacheMissReason', Thrift.Type.STRING, 3334); - output.writeString(this.remoteCacheMissReason); - output.writeFieldEnd(); - } - if (this.fetchDisposition !== null && this.fetchDisposition !== undefined) { - output.writeFieldBegin('fetchDisposition', Thrift.Type.I32, 3335); - output.writeI32(this.fetchDisposition); - output.writeFieldEnd(); - } - if (this.remoteResultCacheEnabled !== null && this.remoteResultCacheEnabled !== undefined) { - output.writeFieldBegin('remoteResultCacheEnabled', Thrift.Type.BOOL, 3336); - output.writeBool(this.remoteResultCacheEnabled); - output.writeFieldEnd(); - } - if (this.isServerless !== null && this.isServerless !== undefined) { - output.writeFieldBegin('isServerless', Thrift.Type.BOOL, 3337); - output.writeBool(this.isServerless); - output.writeFieldEnd(); - } - if (this.resultDataFormat !== null && this.resultDataFormat !== undefined) { - output.writeFieldBegin('resultDataFormat', Thrift.Type.STRUCT, 3344); - this.resultDataFormat.write(output); - output.writeFieldEnd(); - } - if (this.truncatedByThriftLimit !== null && this.truncatedByThriftLimit !== undefined) { - output.writeFieldBegin('truncatedByThriftLimit', Thrift.Type.BOOL, 3345); - output.writeBool(this.truncatedByThriftLimit); - output.writeFieldEnd(); - } - if (this.resultByteLimit !== null && this.resultByteLimit !== undefined) { - output.writeFieldBegin('resultByteLimit', Thrift.Type.I64, 3346); - output.writeI64(this.resultByteLimit); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -10417,7 +8349,6 @@ var TFetchResultsResp = module.exports.TFetchResultsResp = function(args) { this.hasMoreRows = null; this.results = null; this.resultSetMetadata = null; - this.responseValidation = null; if (args) { if (args.status !== undefined && args.status !== null) { this.status = new ttypes.TStatus(args.status); @@ -10433,9 +8364,6 @@ var TFetchResultsResp = module.exports.TFetchResultsResp = function(args) { if (args.resultSetMetadata !== undefined && args.resultSetMetadata !== null) { this.resultSetMetadata = new ttypes.TGetResultSetMetadataResp(args.resultSetMetadata); } - if (args.responseValidation !== undefined && args.responseValidation !== null) { - this.responseValidation = args.responseValidation; - } } }; TFetchResultsResp.prototype = {}; @@ -10480,13 +8408,6 @@ TFetchResultsResp.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRING) { - this.responseValidation = input.readBinary(); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -10518,11 +8439,6 @@ TFetchResultsResp.prototype.write = function(output) { this.resultSetMetadata.write(output); output.writeFieldEnd(); } - if (this.responseValidation !== null && this.responseValidation !== undefined) { - output.writeFieldBegin('responseValidation', Thrift.Type.STRING, 3329); - output.writeBinary(this.responseValidation); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -10532,7 +8448,6 @@ var TGetDelegationTokenReq = module.exports.TGetDelegationTokenReq = function(ar this.sessionHandle = null; this.owner = null; this.renewer = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -10549,9 +8464,6 @@ var TGetDelegationTokenReq = module.exports.TGetDelegationTokenReq = function(ar } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field renewer is unset!'); } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TGetDelegationTokenReq.prototype = {}; @@ -10587,14 +8499,6 @@ TGetDelegationTokenReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -10621,11 +8525,6 @@ TGetDelegationTokenReq.prototype.write = function(output) { output.writeString(this.renewer); output.writeFieldEnd(); } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3329); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -10700,7 +8599,6 @@ TGetDelegationTokenResp.prototype.write = function(output) { var TCancelDelegationTokenReq = module.exports.TCancelDelegationTokenReq = function(args) { this.sessionHandle = null; this.delegationToken = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -10712,9 +8610,6 @@ var TCancelDelegationTokenReq = module.exports.TCancelDelegationTokenReq = funct } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field delegationToken is unset!'); } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TCancelDelegationTokenReq.prototype = {}; @@ -10743,14 +8638,6 @@ TCancelDelegationTokenReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -10772,11 +8659,6 @@ TCancelDelegationTokenReq.prototype.write = function(output) { output.writeString(this.delegationToken); output.writeFieldEnd(); } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3329); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -10838,7 +8720,6 @@ TCancelDelegationTokenResp.prototype.write = function(output) { var TRenewDelegationTokenReq = module.exports.TRenewDelegationTokenReq = function(args) { this.sessionHandle = null; this.delegationToken = null; - this.sessionConf = null; if (args) { if (args.sessionHandle !== undefined && args.sessionHandle !== null) { this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle); @@ -10850,9 +8731,6 @@ var TRenewDelegationTokenReq = module.exports.TRenewDelegationTokenReq = functio } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field delegationToken is unset!'); } - if (args.sessionConf !== undefined && args.sessionConf !== null) { - this.sessionConf = new ttypes.TDBSqlSessionConf(args.sessionConf); - } } }; TRenewDelegationTokenReq.prototype = {}; @@ -10881,14 +8759,6 @@ TRenewDelegationTokenReq.prototype.read = function(input) { input.skip(ftype); } break; - case 3329: - if (ftype == Thrift.Type.STRUCT) { - this.sessionConf = new ttypes.TDBSqlSessionConf(); - this.sessionConf.read(input); - } else { - input.skip(ftype); - } - break; default: input.skip(ftype); } @@ -10910,11 +8780,6 @@ TRenewDelegationTokenReq.prototype.write = function(output) { output.writeString(this.delegationToken); output.writeFieldEnd(); } - if (this.sessionConf !== null && this.sessionConf !== undefined) { - output.writeFieldBegin('sessionConf', Thrift.Type.STRUCT, 3329); - this.sessionConf.write(output); - output.writeFieldEnd(); - } output.writeFieldStop(); output.writeStructEnd(); return; @@ -11027,12 +8892,12 @@ TProgressUpdateResp.prototype.read = function(input) { case 1: if (ftype == Thrift.Type.LIST) { this.headerNames = []; - var _rtmp3215 = input.readListBegin(); - var _size214 = _rtmp3215.size || 0; - for (var _i216 = 0; _i216 < _size214; ++_i216) { - var elem217 = null; - elem217 = input.readString(); - this.headerNames.push(elem217); + var _rtmp3167 = input.readListBegin(); + var _size166 = _rtmp3167.size || 0; + for (var _i168 = 0; _i168 < _size166; ++_i168) { + var elem169 = null; + elem169 = input.readString(); + this.headerNames.push(elem169); } input.readListEnd(); } else { @@ -11042,20 +8907,20 @@ TProgressUpdateResp.prototype.read = function(input) { case 2: if (ftype == Thrift.Type.LIST) { this.rows = []; - var _rtmp3219 = input.readListBegin(); - var _size218 = _rtmp3219.size || 0; - for (var _i220 = 0; _i220 < _size218; ++_i220) { - var elem221 = null; - elem221 = []; - var _rtmp3223 = input.readListBegin(); - var _size222 = _rtmp3223.size || 0; - for (var _i224 = 0; _i224 < _size222; ++_i224) { - var elem225 = null; - elem225 = input.readString(); - elem221.push(elem225); + var _rtmp3171 = input.readListBegin(); + var _size170 = _rtmp3171.size || 0; + for (var _i172 = 0; _i172 < _size170; ++_i172) { + var elem173 = null; + elem173 = []; + var _rtmp3175 = input.readListBegin(); + var _size174 = _rtmp3175.size || 0; + for (var _i176 = 0; _i176 < _size174; ++_i176) { + var elem177 = null; + elem177 = input.readString(); + elem173.push(elem177); } input.readListEnd(); - this.rows.push(elem221); + this.rows.push(elem173); } input.readListEnd(); } else { @@ -11104,10 +8969,10 @@ TProgressUpdateResp.prototype.write = function(output) { if (this.headerNames !== null && this.headerNames !== undefined) { output.writeFieldBegin('headerNames', Thrift.Type.LIST, 1); output.writeListBegin(Thrift.Type.STRING, this.headerNames.length); - for (var iter226 in this.headerNames) { - if (this.headerNames.hasOwnProperty(iter226)) { - iter226 = this.headerNames[iter226]; - output.writeString(iter226); + for (var iter178 in this.headerNames) { + if (this.headerNames.hasOwnProperty(iter178)) { + iter178 = this.headerNames[iter178]; + output.writeString(iter178); } } output.writeListEnd(); @@ -11116,14 +8981,14 @@ TProgressUpdateResp.prototype.write = function(output) { if (this.rows !== null && this.rows !== undefined) { output.writeFieldBegin('rows', Thrift.Type.LIST, 2); output.writeListBegin(Thrift.Type.LIST, this.rows.length); - for (var iter227 in this.rows) { - if (this.rows.hasOwnProperty(iter227)) { - iter227 = this.rows[iter227]; - output.writeListBegin(Thrift.Type.STRING, iter227.length); - for (var iter228 in iter227) { - if (iter227.hasOwnProperty(iter228)) { - iter228 = iter227[iter228]; - output.writeString(iter228); + for (var iter179 in this.rows) { + if (this.rows.hasOwnProperty(iter179)) { + iter179 = this.rows[iter179]; + output.writeListBegin(Thrift.Type.STRING, iter179.length); + for (var iter180 in iter179) { + if (iter179.hasOwnProperty(iter180)) { + iter180 = iter179[iter180]; + output.writeString(iter180); } } output.writeListEnd();