Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
961f074
Complete configured Volume operations in the native backend
aakash-saravanan-db Nov 13, 2026
6f65ad2
Retain inline results for configured Volume transfers
aakash-saravanan-db Nov 13, 2026
4845435
Correct Volume backend support documentation
aakash-saravanan-db Nov 13, 2026
fc5f64b
Pin the native source for Volume completion
aakash-saravanan-db Nov 14, 2026
59a8bcb
Select the Volume kernel and format its path option
aakash-saravanan-db Nov 14, 2026
596b72a
Regenerate Volume completion declarations from the pinned kernel
aakash-saravanan-db Nov 14, 2026
5e7dda4
Preserve SQL execution errors during Volume completion
aakash-saravanan-db Nov 14, 2026
b764466
Pin native Volume storage retry and terminal response fixes
aakash-saravanan-db Nov 14, 2026
d4b2d1b
Cover portable native local file error decoding
aakash-saravanan-db Nov 14, 2026
bc92855
Preserve deferred Volume instruction HTTP errors
aakash-saravanan-db Nov 14, 2026
160d52b
Preserve portable file error fallback for unknown errno values
aakash-saravanan-db Nov 14, 2026
df2250a
build(kernel): select corrected Volume completion
aakash-saravanan-db Nov 14, 2026
c7df924
build: select native Volume cancellation and error handling
aakash-saravanan-db Nov 15, 2026
794047d
build: use native root authorization fix
aakash-saravanan-db Nov 15, 2026
53409f2
build: update kernel source for replayable uploads
aakash-saravanan-db Nov 15, 2026
4443bbb
build: update kernel for local stream close
aakash-saravanan-db Nov 15, 2026
c25514e
fix(volume): select replayable file uploads and tighten validation
aakash-saravanan-db Nov 15, 2026
5d677c7
fix(kernel): use permission-preserving Volume downloads
aakash-saravanan-db Nov 16, 2026
453ebfe
build(kernel): select sanitized storage redirects
aakash-saravanan-db Nov 16, 2026
6c89f8b
Clarify Volume cancellation and consolidate routing coverage
aakash-saravanan-db Nov 16, 2026
2b33f67
Validate native file error numbers and select shared completion
aakash-saravanan-db Nov 16, 2026
1e82ad4
Pin kernel with statement lifecycle cleanup
aakash-saravanan-db Nov 16, 2026
b4796d2
build: select kernel with async result cleanup
aakash-saravanan-db Nov 16, 2026
126b73a
build: select kernel with Volume instruction error telemetry
aakash-saravanan-db Nov 16, 2026
c06f403
build: pin kernel with complete Volume instruction handling
aakash-saravanan-db Nov 16, 2026
e616321
fix(kernel): preserve ordinary post-SQL cancellation routing
aakash-saravanan-db Nov 17, 2026
000fd77
build: use corrected kernel volume completion
aakash-saravanan-db Nov 17, 2026
6aad428
build: select kernel with origin-safe Volume redirects
aakash-saravanan-db Nov 17, 2026
abb780c
build: select kernel with normalized upload lengths
aakash-saravanan-db Nov 17, 2026
95a78de
build: pin kernel completion telemetry correction
aakash-saravanan-db Nov 17, 2026
1efb140
build: select kernel with restricted-directory GET support
aakash-saravanan-db Nov 18, 2026
ff07711
fix(kernel): cancel pending result waits before close
aakash-saravanan-db Nov 18, 2026
21c1cf6
fix(kernel): await shared statement disposal on close
aakash-saravanan-db Nov 18, 2026
63f73b4
Finalize concurrent operation cleanup once
aakash-saravanan-db Nov 18, 2026
d800a09
build: pin kernel with bounded symlink resolution
aakash-saravanan-db Nov 18, 2026
9645013
refactor(volume): reduce staging completion plumbing
aakash-saravanan-db Nov 19, 2026
939073e
build: select updated Volume kernel
aakash-saravanan-db Nov 19, 2026
0ee881a
fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
c70f07c
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
19f27d4
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
c7b40a0
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
9985b8f
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
f4099f8
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
3ffcdf3
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
31e1987
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 21, 2026
f36f6de
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 22, 2026
383339e
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 22, 2026
8e79667
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
390e488
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
fa84be4
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
92e8987
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
ba3fe87
fix(volume): classify staging errors by kernel code
aakash-saravanan-db Nov 24, 2026
6a76066
docs(volume): explain local file error shape
aakash-saravanan-db Nov 24, 2026
8fea48b
fix(deps): repin and regenerate the Volume binding
aakash-saravanan-db Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/kernel-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
# Run when the kernel driver layer, the napi binding contract, kernel
# e2e tests, this workflow, the kernel revision pin, or core deps
# move.
if echo "$CHANGED" | grep -qE "^(lib/kernel/|lib/result/|native/kernel/|tests/e2e/kernel/|tests/e2e/utils/rowMaterialization\.ts|tests/unit/kernel/|\.github/workflows/kernel-e2e\.yml|KERNEL_REV|package\.json|package-lock\.json)"; then
if echo "$CHANGED" | grep -qE "^(lib/kernel/|lib/result/|native/kernel/|tests/e2e/kernel/|tests/e2e/utils/rowMaterialization\.ts|tests/e2e/utils/stagingTests\.ts|tests/unit/kernel/|\.github/workflows/kernel-e2e\.yml|KERNEL_REV|package\.json|package-lock\.json)"; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=false" >> "$GITHUB_OUTPUT"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Release completed Thrift CloudFetch body-reader listeners so idle connections do not retain downloaded result buffers.
- Support Volume file transfers on the kernel backend when `stagingAllowedLocalPath` is supplied. Symlink targets must remain within configured allowed roots; in-root symlinks are permitted. (#613)
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved

## 3.1.0

Expand Down
9 changes: 6 additions & 3 deletions CONNECTION_PARAMETERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,17 @@ telemetry implementation, so only the options explicitly forwarded by
| `maxRows` | `number \| bigint \| Int64 \| null` | ✅ | ❌ | `100000` / — | Thrift uses it for the initial Direct Results row count; `null` disables Direct Results. Kernel does not retain or forward the supplied value. |
| `useCloudFetch` | `boolean` | ✅ | ❌ | `true` / — | Kernel logs and ignores this per-statement hint; Kernel result fetching owns its CloudFetch behavior. |
| `useLZ4Compression` | `boolean` | ✅ | ❌ | `true` / — | Thrift uses it when supported and when the result is not CloudFetch. Kernel owns and auto-detects result compression. |
| `stagingAllowedLocalPath` | `string \| string[]` | ✅ | ❌ | — | Local allowlist for Thrift volume/staging operations. Kernel volume operations are unsupported. |
| `stagingAllowedLocalPath` | `string \| string[]` | ✅ | ✅ | — | Local allowlist for Volume operations. Kernel also requires resolved symlink targets within allowed roots; links within those roots are permitted. |
| `namedParameters` | `Record<string, DBSQLParameter \| DBSQLParameterValue>` | ✅ | ✅ | — | Named SQL parameters. Cannot be combined with non-empty `ordinalParameters`. Thrift requires a protocol that supports parameterized queries. |
| `ordinalParameters` | `Array<DBSQLParameter \| DBSQLParameterValue>` | ✅ | ✅ | — | Positional SQL parameters. Cannot be combined with non-empty `namedParameters`. |
| `queryTags` | `Record<string, string \| null \| undefined>` | ✅ | ✅ | — | Serialized into the per-statement `query_tags` conf overlay on both. |
| `rowLimit` | `number` | ❌ | ✅ | — | Kernel-only server-side row cap. Thrift logs and ignores it. |
| `statementConf` | `Record<string, string>` | ❌ | ✅ | — | Kernel-only per-statement Spark conf overlay. Structured `queryTags` overwrite its `query_tags` key when non-empty. |

With `stagingAllowedLocalPath`, closing the session on the kernel backend stops
a running transfer. The Thrift backend lets it finish.
A GET that has started copying into the destination finishes the copy.

## Metadata-operation request parameters

The public session metadata methods also accept request objects. These are not
Expand All @@ -244,8 +248,7 @@ session parameter surface.

Thrift-only capabilities include custom/token-provider authentication, custom
OAuth persistence, SOCKS proxies, authenticated/driver-buffer telemetry knobs,
query timeout, Direct Results `maxRows`, per-statement CloudFetch/LZ4 hints, and
volume operations.
query timeout, Direct Results `maxRows`, and per-statement CloudFetch/LZ4 hints.

Kernel-only capabilities include connection-pool sizing, proxy bypass hosts,
independent TLS hostname verification, optional U2M disk caching, and
Expand Down
2 changes: 1 addition & 1 deletion KERNEL_REV
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5c3a909771f749174567af074bfe18c24a335f5c
088cb40f4f6e861936688fb4115f712d28bef4da
21 changes: 11 additions & 10 deletions lib/DBSQLSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,20 @@ export default class DBSQLSession implements IDBSQLSession {
const opBackend = await this.runBackend(() => this.backend.executeStatement(statement, options));
const operation = this.wrapOperation(opBackend);

// If `stagingAllowedLocalPath` is provided - assume that operation possibly may be a staging operation.
// To know for sure, fetch metadata and check a `isStagingOperation` flag. If it happens that it wasn't
// a staging operation - not a big deal, we just fetched metadata earlier, but operation is still usable
// and user can get data from it.
// If `stagingAllowedLocalPath` is not provided - don't do anything to the operation. In a case of regular
// operation, everything will work as usual. In a case of staging operation, it will be processed like any
// other query - it will be possible to get data from it as usual, or use other operation methods.
// With `stagingAllowedLocalPath`, a staging statement runs its file transfer here. A backend
// that transfers by itself (kernel) completes it; otherwise the Thrift path checks the
// `isStagingOperation` metadata flag and transfers. An ordinary statement stays usable either way.
// Without the option nothing is done, and a staging statement behaves like any other query.
if (options.stagingAllowedLocalPath !== undefined) {
const allowedLocalPath = Array.isArray(options.stagingAllowedLocalPath)
? options.stagingAllowedLocalPath
: [options.stagingAllowedLocalPath];
if (opBackend.completeStagingOperation) {
await this.runBackend(() => opBackend.completeStagingOperation!(allowedLocalPath));
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
return operation;
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
}
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
const metadata = await operation.getResultMetadata();
if (metadata.isStagingOperation) {
const allowedLocalPath = Array.isArray(options.stagingAllowedLocalPath)
? options.stagingAllowedLocalPath
: [options.stagingAllowedLocalPath];
return this.handleStagingOperation(operation, allowedLocalPath, metadata);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/contracts/IDBSQLSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export type ExecuteStatementOptions = {
* `false`/unset (default) runs the blocking direct-results path (faster,
* cancellable mid-compute); `true` submits and polls (returns a pending
* handle before completion). Default is sync, matching the python
* connector's `cursor.execute()`.
* connector's `cursor.execute()`. With `stagingAllowedLocalPath` set,
* `executeStatement` resolves only after the statement finishes, regardless of this option.
*/
runAsync?: boolean;
maxRows?: number | bigint | Int64 | null;
Expand Down
4 changes: 4 additions & 0 deletions lib/contracts/IOperationBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export default interface IOperationBackend {
*/
getCachedResultMetadata?(): ResultMetadata | undefined;

/** Runs the staging (Volume) file transfer.
* Only backends that transfer by themselves implement it. */
completeStagingOperation?(allowedPaths: string[]): Promise<void>;

/** Cancel the operation. */
cancel(): Promise<Status>;

Expand Down
45 changes: 44 additions & 1 deletion lib/kernel/KernelErrorMapping.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { constants } from 'node:os';
import { getSystemErrorName } from 'node:util';
import HiveDriverError from '../errors/HiveDriverError';
import AuthenticationError from '../errors/AuthenticationError';
import OperationStateError, { OperationStateErrorCode } from '../errors/OperationStateError';
import ParameterError from '../errors/ParameterError';
import StagingError from '../errors/StagingError';

const kindCodes: Record<string, string> = {
NotFound: 'ENOENT',
PermissionDenied: 'EACCES',
AlreadyExists: 'EEXIST',
NotADirectory: 'ENOTDIR',
IsADirectory: 'EISDIR',
};

/**
* Sentinel prefix the napi binding's `napi_err_from_kernel` puts on
Expand Down Expand Up @@ -111,6 +122,23 @@ function defineErrorMetadata<K extends string, V>(error: Error, key: K, value: V
});
}

const STAGING_ERROR_CODES = new Set([
'VOLUME_STORAGE_HTTP_ERROR',
'VOLUME_PATH_NOT_ALLOWED',
'VOLUME_INVALID_INSTRUCTION',
]);

export function toStagingTransferError(mapped: ErrorWithSqlState): ErrorWithSqlState {
const metadata = mapped.kernelMetadata;
if (metadata?.errorCode && STAGING_ERROR_CODES.has(metadata.errorCode)) {
const staging = new StagingError(mapped.message);
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
if (metadata) defineErrorMetadata(staging, 'kernelMetadata', metadata);
if ('cause' in mapped) defineErrorMetadata(staging, 'cause', mapped.cause);
return staging;
}
return mapped;
}

/**
* Map a kernel error (as surfaced by the napi-binding) to the appropriate JS
* driver error class.
Expand Down Expand Up @@ -311,7 +339,22 @@ export function decodeNapiKernelError(err: unknown): Error {
const msg = envelope.message as string;
const sqlState = typeof envelope.sqlState === 'string' ? envelope.sqlState : undefined;

const jsErr = mapKernelErrorToJsError({ code, message: msg, sqlstate: sqlState });
let jsErr = mapKernelErrorToJsError({ code, message: msg, sqlstate: sqlState });
if (typeof envelope.localPath === 'string' && typeof envelope.localErrorKind === 'string') {
const raw =
typeof envelope.localOsError === 'number' && Number.isSafeInteger(envelope.localOsError)
? envelope.localOsError
: undefined;
const systemCode = process.platform !== 'win32' && raw ? getSystemErrorName(-Math.abs(raw)) : undefined;
Comment thread
oss-reviewer-bot[bot] marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
const localCode =
systemCode && systemCode in constants.errno ? systemCode : kindCodes[envelope.localErrorKind] ?? 'EIO';
// Shaped like a Node fs error, which carries no sqlState.
jsErr = Object.assign(new Error(msg), {
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
code: localCode,
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
errno: -(constants.errno as Record<string, number>)[localCode],
path: envelope.localPath,
});
}

const meta = buildKernelMetadata(envelope);
// Skip the namespace attachment entirely when no fields validated
Expand Down
35 changes: 32 additions & 3 deletions lib/kernel/KernelOperationBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ import { LogLevel } from '../contracts/IDBSQLLogger';
import { RowMode } from '../contracts/IDBSQLSession';
import Status from '../dto/Status';
import HiveDriverError from '../errors/HiveDriverError';
import StagingError from '../errors/StagingError';
import OperationStateError, { OperationStateErrorCode } from '../errors/OperationStateError';
import ArrowResultConverter from '../result/ArrowResultConverter';
import ResultSlicer from '../result/ResultSlicer';
import KernelResultsProvider from './KernelResultsProvider';
import { arrowSchemaToThriftSchema, decodeIpcSchema, patchIpcBytes } from './KernelArrowIpc';
import { decodeNapiKernelError } from './KernelErrorMapping';
import { decodeNapiKernelError, toStagingTransferError } from './KernelErrorMapping';
import {
KernelStatement,
KernelNativeAsyncStatement,
Expand Down Expand Up @@ -84,7 +85,10 @@ export type KernelOperationStatement = KernelStatementHandle & Partial<KernelSta
* (`KernelResultsProvider` → `ArrowResultConverter` → `ResultSlicer`) consumes
* either interchangeably.
*/
type KernelFetchHandle = Pick<KernelStatement, 'fetchNextBatch' | 'schema'>;
type KernelFetchHandle = Pick<
KernelStatement,
'fetchNextBatch' | 'schema' | 'isVolumeOperation' | 'completeVolumeOperation'
>;

/**
* The rich operation-status surface the kernel exposes on a terminal sync
Expand Down Expand Up @@ -220,6 +224,8 @@ export default class KernelOperationBackend implements IOperationBackend {
// already-terminal statement. Drives both fetch and result-metadata.
private fetchHandlePromise?: Promise<KernelFetchHandle>;

private volumeCompleted = false;

// Async path only: set once the kernel reported the statement Succeeded (a
// status poll, or `awaitResult()` resolving). The kernel exposes no
// synchronous terminal-state accessor, so the observed success is retained.
Expand Down Expand Up @@ -308,6 +314,27 @@ export default class KernelOperationBackend implements IOperationBackend {
// Fetch / metadata (owned by the kernel-results pipeline).
// ---------------------------------------------------------------------------

public async completeStagingOperation(allowedPaths: string[]): Promise<void> {
failIfNotActive(this.lifecycle);
await this.waitUntilReady();
const handle = await this.getFetchHandle();
let outcome;
try {
outcome = await handle.completeVolumeOperation(allowedPaths, true); // Thrift REMOVE treats missing objects as success.
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
} catch (err) {
if (this.lifecycle.isCancelled || this.closeRequested) {
throw new OperationStateError(
this.lifecycle.isCancelled ? OperationStateErrorCode.Canceled : OperationStateErrorCode.Closed,
);
}
throw toStagingTransferError(decodeNapiKernelError(err));
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
Comment thread
aakash-saravanan-db marked this conversation as resolved.
Resolved
}
if (outcome === 'needs_input_stream') {
throw new StagingError('Volume PUT requires a local file path');
}
this.volumeCompleted = outcome === 'completed';
}

public async fetchChunk({
limit,
disableBuffering,
Expand All @@ -320,6 +347,7 @@ export default class KernelOperationBackend implements IOperationBackend {
// Cancel-mid-fetch propagation: if cancel() has flipped the
// lifecycle flag, fail locally without a wire round-trip.
failIfNotActive(this.lifecycle);
if (this.volumeCompleted) return [];
// Cooperative cancel (parity with ThriftOperationBackend): the facade
// supplies `isClosed` and re-checks `failIfClosed()` after we return, so
// bailing with `[]` at a yield point is the contract-correct way for a
Expand All @@ -340,6 +368,7 @@ export default class KernelOperationBackend implements IOperationBackend {

public async hasMore(): Promise<boolean> {
failIfNotActive(this.lifecycle);
if (this.volumeCompleted) return false;
try {
// `hasMore()` prefetches the next batch, so it fails like `fetchChunk()`.
const slicer = await this.getResultSlicer();
Expand Down Expand Up @@ -383,7 +412,7 @@ export default class KernelOperationBackend implements IOperationBackend {
// `arrowSchema` doesn't hit apache-arrow@13's `Unrecognized type
// "Duration" (18)`. Matches what the per-batch fetch path already does.
arrowSchema: patchIpcBytes(arrowSchemaIpc.ipcBytes),
isStagingOperation: false,
isStagingOperation: handle.isVolumeOperation,
};
this.metadata = meta;
return meta;
Expand Down
19 changes: 4 additions & 15 deletions lib/kernel/KernelSessionBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@ export default class KernelSessionBackend implements ISessionBackend {
* `query_tags` key (the same wire shape Thrift's `serializeQueryTags`
* produces), merged with any explicit `statementConf`.
*
* Still rejected (genuinely unsupported on kernel, rather than silently
* dropped): `useCloudFetch` (governed by the kernel `ResultConfig`, not a
* per-statement knob), `useLZ4Compression` (kernel owns result compression),
* and `stagingAllowedLocalPath` (volume operations). `maxRows` is applied by
* `useCloudFetch` and `useLZ4Compression` are logged and ignored because the
* kernel owns result fetching and compression. `stagingAllowedLocalPath` is
* applied by the facade. `maxRows` is applied by
* the facade at fetch time, so it is intentionally not handled here.
*/
public async executeStatement(statement: string, options: ExecuteStatementOptions): Promise<IOperationBackend> {
Expand All @@ -160,8 +159,7 @@ export default class KernelSessionBackend implements ISessionBackend {
// Per-statement options the kernel backend doesn't honour are treated as
// NO-OPs (logged at warn), not errors — so call sites written for the Thrift
// backend are drop-in on the kernel path. These are perf/format hints the
// kernel governs internally (useCloudFetch / useLZ4Compression) or a feature
// it doesn't expose yet (staging); ignoring them cannot change query results.
// kernel governs internally (useCloudFetch / useLZ4Compression).
// NB: parameter binding (compound/BINARY) is deliberately NOT no-op'd — a
// dropped param would silently change results, so it still throws.
if (options.useCloudFetch !== undefined) {
Expand All @@ -180,15 +178,6 @@ export default class KernelSessionBackend implements ISessionBackend {
'kernel executeStatement: ignoring per-statement `useLZ4Compression` — result compression is governed by the kernel (no-op on kernel).',
);
}
if (options.stagingAllowedLocalPath !== undefined) {
this.context
.getLogger()
.log(
LogLevel.warn,
'kernel executeStatement: ignoring `stagingAllowedLocalPath` — volume/staging operations are not yet supported on the kernel backend (no-op).',
);
}

// `runAsync` selects the kernel execution path. NOTE: this is a kernel-
// specific use of the option — the Thrift backend hardcodes `runAsync: true`
// on the wire and never reads `options.runAsync`, so the field is a no-op
Expand Down
Loading
Loading