Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5d709aa
Complete configured Volume operations in the native backend
aakash-saravanan-db Nov 13, 2026
41fde00
Retain inline results for configured Volume transfers
aakash-saravanan-db Nov 13, 2026
ad2f45f
Correct Volume backend support documentation
aakash-saravanan-db Nov 13, 2026
41033ed
Pin the native source for Volume completion
aakash-saravanan-db Nov 14, 2026
f385c91
Select the Volume kernel and format its path option
aakash-saravanan-db Nov 14, 2026
842f9a9
Regenerate Volume completion declarations from the pinned kernel
aakash-saravanan-db Nov 14, 2026
3f6ddb2
Preserve SQL execution errors during Volume completion
aakash-saravanan-db Nov 14, 2026
dfa5ffb
Pin native Volume storage retry and terminal response fixes
aakash-saravanan-db Nov 14, 2026
7b34ad1
Cover portable native local file error decoding
aakash-saravanan-db Nov 14, 2026
43e09ca
Preserve deferred Volume instruction HTTP errors
aakash-saravanan-db Nov 14, 2026
808f0e4
Preserve portable file error fallback for unknown errno values
aakash-saravanan-db Nov 14, 2026
bcd4d78
build(kernel): select corrected Volume completion
aakash-saravanan-db Nov 14, 2026
f1c9c45
build: select native Volume cancellation and error handling
aakash-saravanan-db Nov 15, 2026
5ff411a
build: use native root authorization fix
aakash-saravanan-db Nov 15, 2026
9f13ce1
build: update kernel source for replayable uploads
aakash-saravanan-db Nov 15, 2026
1ebc864
build: update kernel for local stream close
aakash-saravanan-db Nov 15, 2026
2d43575
fix(volume): select replayable file uploads and tighten validation
aakash-saravanan-db Nov 15, 2026
30dd270
fix(kernel): use permission-preserving Volume downloads
aakash-saravanan-db Nov 16, 2026
6e03dea
build(kernel): select sanitized storage redirects
aakash-saravanan-db Nov 16, 2026
8a46598
Clarify Volume cancellation and consolidate routing coverage
aakash-saravanan-db Nov 16, 2026
7871b84
Validate native file error numbers and select shared completion
aakash-saravanan-db Nov 16, 2026
f82295c
Pin kernel with statement lifecycle cleanup
aakash-saravanan-db Nov 16, 2026
18f3a9c
build: select kernel with async result cleanup
aakash-saravanan-db Nov 16, 2026
31c2cfb
build: select kernel with Volume instruction error telemetry
aakash-saravanan-db Nov 16, 2026
ca472dc
build: pin kernel with complete Volume instruction handling
aakash-saravanan-db Nov 16, 2026
fef006e
fix(kernel): preserve ordinary post-SQL cancellation routing
aakash-saravanan-db Nov 17, 2026
1e96b8b
build: use corrected kernel volume completion
aakash-saravanan-db Nov 17, 2026
e1a2565
build: select kernel with origin-safe Volume redirects
aakash-saravanan-db Nov 17, 2026
8e92502
build: select kernel with normalized upload lengths
aakash-saravanan-db Nov 17, 2026
22e533f
build: pin kernel completion telemetry correction
aakash-saravanan-db Nov 17, 2026
75084c2
build: select kernel with restricted-directory GET support
aakash-saravanan-db Nov 18, 2026
10fc529
fix(kernel): cancel pending result waits before close
aakash-saravanan-db Nov 18, 2026
8559f5f
fix(kernel): await shared statement disposal on close
aakash-saravanan-db Nov 18, 2026
497b4d2
Finalize concurrent operation cleanup once
aakash-saravanan-db Nov 18, 2026
9fbe59e
build: pin kernel with bounded symlink resolution
aakash-saravanan-db Nov 18, 2026
e84a9aa
refactor(volume): reduce staging completion plumbing
aakash-saravanan-db Nov 19, 2026
49a9891
build: select updated Volume kernel
aakash-saravanan-db Nov 19, 2026
3dd49eb
fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
098892c
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
5fb4b8d
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
5c48316
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
47a8d32
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
9b43bce
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
785f532
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 20, 2026
c161395
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 21, 2026
b679c7b
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 22, 2026
505399b
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 22, 2026
74058ca
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
8892813
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
12fc9b5
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
41a7e96
fixup! fix(volume): poll staged statements before native completion
aakash-saravanan-db Nov 23, 2026
aa36c71
fix(volume): classify staging errors by kernel code
aakash-saravanan-db Nov 24, 2026
060f5c7
docs(volume): explain local file error shape
aakash-saravanan-db Nov 24, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## Unreleased

- 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

## 3.1.0

- Upgrade to [kernel 1.5.0](https://github.com/databricks/databricks-sql-kernel/releases/tag/v1.5.0): fix CloudFetch pagination, ordering and cancellation, paged inline Arrow results with CloudFetch disabled, and affected-row counts.
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
2d5518601d631e4274f0ab3662235c509e746950
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
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — completeStagingOperation calls handle.completeVolumeOperation unconditionally, and assertBindingShape never checks for it. With an older installed binding (platform packages are still pinned to 1.4.0), kernel executeStatement with stagingAllowedLocalPath throws a raw TypeError. Previously it warned and returned results. Add a capability check that gives a clear error, and bump the pins together with this change.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release gate. The kernel ships as 1.5.0 first; this PR then moves every platform package pin and the lockfile to 1.5.0 before merge, so npm installs get a binding with completeVolumeOperation and the zero-timeout handling. No capability check is added: the TypeScript and the binding ship as one pinned set. Keeping this thread open until the pins move.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 0947cc8: the platform pins in package.json:95-102 are still 1.4.0, so this blocks merge until they move to 1.5.0.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: the zero-timeout handling no longer applies. socketTimeout is back to main's behaviour and does not limit Volume transfers, same as Thrift. The pin gate stands.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 292db68: package.json:95-102 still pins every platform package to 1.4.0, so this blocks merge until they move to 1.5.0.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to the gate above: kernel 1.5.0 was released on 2026-11-23 without the Volume API, so the 1.5.0 pins now in package.json do not meet it. The gate is the first kernel release that includes databricks-sql-kernel#465; the platform package pins and the lockfile move to that release before merge. Keeping this thread open until then.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at aa36c71: package.json:95-102 pins 1.5.0, and that release lacks completeVolumeOperation. Merge stays blocked until a release with kernel#465 is pinned.

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