import { TTableSchema } from '../../thrift/TCLIService_types'; import IClientContext from '../contracts/IClientContext'; import IResultsProvider, { ResultsProviderFetchNextOptions } from './IResultsProvider'; import { ArrowBatch } from './utils'; /** * Metadata key carrying the original Arrow `Duration` time unit on fields * rewritten to `Int64` by the kernel IPC pre-processor * (`lib/kernel/KernelArrowIpcDurationFix.ts`). Re-declared here (rather than * imported) to keep this generic `lib/result` converter free of a * compile-time dependency on `lib/kernel`. * * **kernel-gated by construction — NOT shared with Thrift.** This key (and the * `DataType.isInterval` / duration branches below) only ever execute on the * kernel path. The Thrift backend sets `intervalTypesAsArrow: false` and maps * both INTERVAL `TTypeId`s to `ArrowString` (`lib/result/utils.ts`), so the * server pre-formats intervals to strings and this logic is never reached. * `export`ed so `KernelIntervalParity.test` can pin it equal to the kernel-side * declaration and catch a rename/typo that would silently no-op the consumer. */ export declare const DURATION_UNIT_METADATA_KEY = "databricks.arrow.duration_unit"; /** * Render an Arrow `Decimal` value — supplied as its unscaled integer (from * `bigNumToBigInt`) plus the column `scale` — as an exact decimal string, * e.g. unscaled `1234567890` / scale `5` → `"12345.67890"`. Used by the * precision-preserving path so high-precision DECIMALs survive the round-trip * instead of being flattened to an IEEE-754 double. */ export declare function bigNumDecimalToString(unscaled: bigint, scale: number): string; export default class ArrowResultConverter implements IResultsProvider> { private readonly context; private readonly source; private readonly schema; private readonly preserveBigNumericPrecision; private recordBatchReader?; private remainingRows; private prefetchedRecordBatch?; constructor(context: IClientContext, source: IResultsProvider, { schema }: { schema?: TTableSchema; }, { preserveBigNumericPrecision }?: { preserveBigNumericPrecision?: boolean; }); hasMore(): Promise; fetchNext(options: ResultsProviderFetchNextOptions): Promise; private prefetch; private getRows; private convertArrowTypes; private convertThriftTypes; }