@jaepil/uqa 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +788 -0
- package/dist/types/src/analysis/analyzer.d.ts +27 -0
- package/dist/types/src/analysis/analyzer.d.ts.map +1 -0
- package/dist/types/src/analysis/char-filter.d.ts +27 -0
- package/dist/types/src/analysis/char-filter.d.ts.map +1 -0
- package/dist/types/src/analysis/token-filter.d.ts +73 -0
- package/dist/types/src/analysis/token-filter.d.ts.map +1 -0
- package/dist/types/src/analysis/tokenizer.d.ts +42 -0
- package/dist/types/src/analysis/tokenizer.d.ts.map +1 -0
- package/dist/types/src/api/query-builder.d.ts +103 -0
- package/dist/types/src/api/query-builder.d.ts.map +1 -0
- package/dist/types/src/cli/repl.d.ts +42 -0
- package/dist/types/src/cli/repl.d.ts.map +1 -0
- package/dist/types/src/core/functor.d.ts +38 -0
- package/dist/types/src/core/functor.d.ts.map +1 -0
- package/dist/types/src/core/hierarchical.d.ts +24 -0
- package/dist/types/src/core/hierarchical.d.ts.map +1 -0
- package/dist/types/src/core/posting-list.d.ts +43 -0
- package/dist/types/src/core/posting-list.d.ts.map +1 -0
- package/dist/types/src/core/types.d.ts +116 -0
- package/dist/types/src/core/types.d.ts.map +1 -0
- package/dist/types/src/engine.d.ts +130 -0
- package/dist/types/src/engine.d.ts.map +1 -0
- package/dist/types/src/execution/batch.d.ts +144 -0
- package/dist/types/src/execution/batch.d.ts.map +1 -0
- package/dist/types/src/execution/physical.d.ts +18 -0
- package/dist/types/src/execution/physical.d.ts.map +1 -0
- package/dist/types/src/execution/relational.d.ts +174 -0
- package/dist/types/src/execution/relational.d.ts.map +1 -0
- package/dist/types/src/execution/scan.d.ts +41 -0
- package/dist/types/src/execution/scan.d.ts.map +1 -0
- package/dist/types/src/execution/spill.d.ts +39 -0
- package/dist/types/src/execution/spill.d.ts.map +1 -0
- package/dist/types/src/fdw/arrow-handler.d.ts +28 -0
- package/dist/types/src/fdw/arrow-handler.d.ts.map +1 -0
- package/dist/types/src/fdw/duckdb-handler.d.ts +32 -0
- package/dist/types/src/fdw/duckdb-handler.d.ts.map +1 -0
- package/dist/types/src/fdw/foreign-table.d.ts +47 -0
- package/dist/types/src/fdw/foreign-table.d.ts.map +1 -0
- package/dist/types/src/fdw/handler.d.ts +52 -0
- package/dist/types/src/fdw/handler.d.ts.map +1 -0
- package/dist/types/src/fusion/attention.d.ts +23 -0
- package/dist/types/src/fusion/attention.d.ts.map +1 -0
- package/dist/types/src/fusion/boolean.d.ts +6 -0
- package/dist/types/src/fusion/boolean.d.ts.map +1 -0
- package/dist/types/src/fusion/learned.d.ts +12 -0
- package/dist/types/src/fusion/learned.d.ts.map +1 -0
- package/dist/types/src/fusion/log-odds.d.ts +87 -0
- package/dist/types/src/fusion/log-odds.d.ts.map +1 -0
- package/dist/types/src/fusion/query-features.d.ts +8 -0
- package/dist/types/src/fusion/query-features.d.ts.map +1 -0
- package/dist/types/src/graph/centrality.d.ts +35 -0
- package/dist/types/src/graph/centrality.d.ts.map +1 -0
- package/dist/types/src/graph/cross-paradigm.d.ts +68 -0
- package/dist/types/src/graph/cross-paradigm.d.ts.map +1 -0
- package/dist/types/src/graph/cypher/ast.d.ts +175 -0
- package/dist/types/src/graph/cypher/ast.d.ts.map +1 -0
- package/dist/types/src/graph/cypher/compiler.d.ts +60 -0
- package/dist/types/src/graph/cypher/compiler.d.ts.map +1 -0
- package/dist/types/src/graph/cypher/lexer.d.ts +82 -0
- package/dist/types/src/graph/cypher/lexer.d.ts.map +1 -0
- package/dist/types/src/graph/cypher/parser.d.ts +50 -0
- package/dist/types/src/graph/cypher/parser.d.ts.map +1 -0
- package/dist/types/src/graph/delta.d.ts +31 -0
- package/dist/types/src/graph/delta.d.ts.map +1 -0
- package/dist/types/src/graph/graph-embedding.d.ts +13 -0
- package/dist/types/src/graph/graph-embedding.d.ts.map +1 -0
- package/dist/types/src/graph/incremental-match.d.ts +16 -0
- package/dist/types/src/graph/incremental-match.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +58 -0
- package/dist/types/src/graph/index.d.ts.map +1 -0
- package/dist/types/src/graph/join.d.ts +18 -0
- package/dist/types/src/graph/join.d.ts.map +1 -0
- package/dist/types/src/graph/message-passing.d.ts +17 -0
- package/dist/types/src/graph/message-passing.d.ts.map +1 -0
- package/dist/types/src/graph/operators.d.ts +81 -0
- package/dist/types/src/graph/operators.d.ts.map +1 -0
- package/dist/types/src/graph/pattern.d.ts +63 -0
- package/dist/types/src/graph/pattern.d.ts.map +1 -0
- package/dist/types/src/graph/posting-list.d.ts +24 -0
- package/dist/types/src/graph/posting-list.d.ts.map +1 -0
- package/dist/types/src/graph/rpq-optimizer.d.ts +25 -0
- package/dist/types/src/graph/rpq-optimizer.d.ts.map +1 -0
- package/dist/types/src/graph/store.d.ts +61 -0
- package/dist/types/src/graph/store.d.ts.map +1 -0
- package/dist/types/src/graph/temporal-filter.d.ts +12 -0
- package/dist/types/src/graph/temporal-filter.d.ts.map +1 -0
- package/dist/types/src/graph/temporal-pattern-match.d.ts +26 -0
- package/dist/types/src/graph/temporal-pattern-match.d.ts.map +1 -0
- package/dist/types/src/graph/temporal-traverse.d.ts +25 -0
- package/dist/types/src/graph/temporal-traverse.d.ts.map +1 -0
- package/dist/types/src/graph/versioned-store.d.ts +64 -0
- package/dist/types/src/graph/versioned-store.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +20 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/joins/base.d.ts +18 -0
- package/dist/types/src/joins/base.d.ts.map +1 -0
- package/dist/types/src/joins/cross-paradigm.d.ts +46 -0
- package/dist/types/src/joins/cross-paradigm.d.ts.map +1 -0
- package/dist/types/src/joins/cross.d.ts +9 -0
- package/dist/types/src/joins/cross.d.ts.map +1 -0
- package/dist/types/src/joins/index.d.ts +7 -0
- package/dist/types/src/joins/index.d.ts.map +1 -0
- package/dist/types/src/joins/inner.d.ts +7 -0
- package/dist/types/src/joins/inner.d.ts.map +1 -0
- package/dist/types/src/joins/outer.d.ts +16 -0
- package/dist/types/src/joins/outer.d.ts.map +1 -0
- package/dist/types/src/joins/semi.d.ts +22 -0
- package/dist/types/src/joins/semi.d.ts.map +1 -0
- package/dist/types/src/joins/sort-merge.d.ts +7 -0
- package/dist/types/src/joins/sort-merge.d.ts.map +1 -0
- package/dist/types/src/math/linalg.d.ts +27 -0
- package/dist/types/src/math/linalg.d.ts.map +1 -0
- package/dist/types/src/math/random.d.ts +15 -0
- package/dist/types/src/math/random.d.ts.map +1 -0
- package/dist/types/src/operators/aggregation.d.ts +65 -0
- package/dist/types/src/operators/aggregation.d.ts.map +1 -0
- package/dist/types/src/operators/attention.d.ts +16 -0
- package/dist/types/src/operators/attention.d.ts.map +1 -0
- package/dist/types/src/operators/backend.d.ts +52 -0
- package/dist/types/src/operators/backend.d.ts.map +1 -0
- package/dist/types/src/operators/base.d.ts +32 -0
- package/dist/types/src/operators/base.d.ts.map +1 -0
- package/dist/types/src/operators/boolean.d.ts +23 -0
- package/dist/types/src/operators/boolean.d.ts.map +1 -0
- package/dist/types/src/operators/calibrated-vector.d.ts +56 -0
- package/dist/types/src/operators/calibrated-vector.d.ts.map +1 -0
- package/dist/types/src/operators/deep-fusion.d.ts +104 -0
- package/dist/types/src/operators/deep-fusion.d.ts.map +1 -0
- package/dist/types/src/operators/deep-learn.d.ts +87 -0
- package/dist/types/src/operators/deep-learn.d.ts.map +1 -0
- package/dist/types/src/operators/hierarchical.d.ts +44 -0
- package/dist/types/src/operators/hierarchical.d.ts.map +1 -0
- package/dist/types/src/operators/hybrid.d.ts +75 -0
- package/dist/types/src/operators/hybrid.d.ts.map +1 -0
- package/dist/types/src/operators/learned-fusion.d.ts +15 -0
- package/dist/types/src/operators/learned-fusion.d.ts.map +1 -0
- package/dist/types/src/operators/multi-field.d.ts +13 -0
- package/dist/types/src/operators/multi-field.d.ts.map +1 -0
- package/dist/types/src/operators/multi-stage.d.ts +12 -0
- package/dist/types/src/operators/multi-stage.d.ts.map +1 -0
- package/dist/types/src/operators/primitive.d.ts +75 -0
- package/dist/types/src/operators/primitive.d.ts.map +1 -0
- package/dist/types/src/operators/progressive-fusion.d.ts +13 -0
- package/dist/types/src/operators/progressive-fusion.d.ts.map +1 -0
- package/dist/types/src/operators/sparse.d.ts +12 -0
- package/dist/types/src/operators/sparse.d.ts.map +1 -0
- package/dist/types/src/planner/cardinality.d.ts +110 -0
- package/dist/types/src/planner/cardinality.d.ts.map +1 -0
- package/dist/types/src/planner/cost-model.d.ts +16 -0
- package/dist/types/src/planner/cost-model.d.ts.map +1 -0
- package/dist/types/src/planner/executor.d.ts +48 -0
- package/dist/types/src/planner/executor.d.ts.map +1 -0
- package/dist/types/src/planner/join-enumerator.d.ts +76 -0
- package/dist/types/src/planner/join-enumerator.d.ts.map +1 -0
- package/dist/types/src/planner/join-graph.d.ts +61 -0
- package/dist/types/src/planner/join-graph.d.ts.map +1 -0
- package/dist/types/src/planner/join-order.d.ts +24 -0
- package/dist/types/src/planner/join-order.d.ts.map +1 -0
- package/dist/types/src/planner/optimizer.d.ts +62 -0
- package/dist/types/src/planner/optimizer.d.ts.map +1 -0
- package/dist/types/src/planner/parallel.d.ts +43 -0
- package/dist/types/src/planner/parallel.d.ts.map +1 -0
- package/dist/types/src/scoring/bayesian-bm25.d.ts +22 -0
- package/dist/types/src/scoring/bayesian-bm25.d.ts.map +1 -0
- package/dist/types/src/scoring/bm25.d.ts +20 -0
- package/dist/types/src/scoring/bm25.d.ts.map +1 -0
- package/dist/types/src/scoring/calibration.d.ts +68 -0
- package/dist/types/src/scoring/calibration.d.ts.map +1 -0
- package/dist/types/src/scoring/external-prior.d.ts +55 -0
- package/dist/types/src/scoring/external-prior.d.ts.map +1 -0
- package/dist/types/src/scoring/fusion-wand.d.ts +19 -0
- package/dist/types/src/scoring/fusion-wand.d.ts.map +1 -0
- package/dist/types/src/scoring/multi-field.d.ts +10 -0
- package/dist/types/src/scoring/multi-field.d.ts.map +1 -0
- package/dist/types/src/scoring/parameter-learner.d.ts +42 -0
- package/dist/types/src/scoring/parameter-learner.d.ts.map +1 -0
- package/dist/types/src/scoring/vector.d.ts +42 -0
- package/dist/types/src/scoring/vector.d.ts.map +1 -0
- package/dist/types/src/scoring/wand.d.ts +51 -0
- package/dist/types/src/scoring/wand.d.ts.map +1 -0
- package/dist/types/src/sql/compiler.d.ts +551 -0
- package/dist/types/src/sql/compiler.d.ts.map +1 -0
- package/dist/types/src/sql/expr-evaluator.d.ts +43 -0
- package/dist/types/src/sql/expr-evaluator.d.ts.map +1 -0
- package/dist/types/src/sql/fts-query.d.ts +60 -0
- package/dist/types/src/sql/fts-query.d.ts.map +1 -0
- package/dist/types/src/sql/table.d.ts +72 -0
- package/dist/types/src/sql/table.d.ts.map +1 -0
- package/dist/types/src/storage/abc/document-store.d.ts +44 -0
- package/dist/types/src/storage/abc/document-store.d.ts.map +1 -0
- package/dist/types/src/storage/abc/graph-store.d.ts +109 -0
- package/dist/types/src/storage/abc/graph-store.d.ts.map +1 -0
- package/dist/types/src/storage/abc/inverted-index.d.ts +118 -0
- package/dist/types/src/storage/abc/inverted-index.d.ts.map +1 -0
- package/dist/types/src/storage/block-max-index.d.ts +45 -0
- package/dist/types/src/storage/block-max-index.d.ts.map +1 -0
- package/dist/types/src/storage/btree-index.d.ts +18 -0
- package/dist/types/src/storage/btree-index.d.ts.map +1 -0
- package/dist/types/src/storage/catalog.d.ts +87 -0
- package/dist/types/src/storage/catalog.d.ts.map +1 -0
- package/dist/types/src/storage/document-store.d.ts +20 -0
- package/dist/types/src/storage/document-store.d.ts.map +1 -0
- package/dist/types/src/storage/index-abc.d.ts +16 -0
- package/dist/types/src/storage/index-abc.d.ts.map +1 -0
- package/dist/types/src/storage/index-manager.d.ts +19 -0
- package/dist/types/src/storage/index-manager.d.ts.map +1 -0
- package/dist/types/src/storage/index-types.d.ts +10 -0
- package/dist/types/src/storage/index-types.d.ts.map +1 -0
- package/dist/types/src/storage/inverted-index.d.ts +55 -0
- package/dist/types/src/storage/inverted-index.d.ts.map +1 -0
- package/dist/types/src/storage/ivf-index.d.ts +57 -0
- package/dist/types/src/storage/ivf-index.d.ts.map +1 -0
- package/dist/types/src/storage/managed-connection.d.ts +64 -0
- package/dist/types/src/storage/managed-connection.d.ts.map +1 -0
- package/dist/types/src/storage/spatial-index.d.ts +18 -0
- package/dist/types/src/storage/spatial-index.d.ts.map +1 -0
- package/dist/types/src/storage/sqlite-document-store.d.ts +54 -0
- package/dist/types/src/storage/sqlite-document-store.d.ts.map +1 -0
- package/dist/types/src/storage/sqlite-graph-store.d.ts +59 -0
- package/dist/types/src/storage/sqlite-graph-store.d.ts.map +1 -0
- package/dist/types/src/storage/sqlite-inverted-index.d.ts +75 -0
- package/dist/types/src/storage/sqlite-inverted-index.d.ts.map +1 -0
- package/dist/types/src/storage/transaction.d.ts +15 -0
- package/dist/types/src/storage/transaction.d.ts.map +1 -0
- package/dist/types/src/storage/vector-index.d.ts +23 -0
- package/dist/types/src/storage/vector-index.d.ts.map +1 -0
- package/dist/uqa.es.js +16156 -0
- package/dist/uqa.es.js.map +1 -0
- package/dist/uqa.umd.js +11 -0
- package/dist/uqa.umd.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { SQLCompiler } from "./sql/compiler.js";
|
|
2
|
+
import type { SQLResult } from "./sql/compiler.js";
|
|
3
|
+
import type { Table } from "./sql/table.js";
|
|
4
|
+
import type { GraphStore } from "./storage/abc/graph-store.js";
|
|
5
|
+
import { QueryBuilder } from "./api/query-builder.js";
|
|
6
|
+
import type { Catalog } from "./storage/catalog.js";
|
|
7
|
+
import type { IndexManager } from "./storage/index-manager.js";
|
|
8
|
+
import type { Transaction } from "./storage/transaction.js";
|
|
9
|
+
import type { PathIndex } from "./graph/index.js";
|
|
10
|
+
import type { ForeignServer, ForeignTable } from "./fdw/foreign-table.js";
|
|
11
|
+
import type { Vertex, Edge, DocId } from "./core/types.js";
|
|
12
|
+
import type { ExecutionContext } from "./operators/base.js";
|
|
13
|
+
export interface EngineOptions {
|
|
14
|
+
dbPath?: string;
|
|
15
|
+
parallelWorkers?: number;
|
|
16
|
+
spillThreshold?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class Engine {
|
|
19
|
+
_tables: Map<string, Table>;
|
|
20
|
+
_views: Map<string, unknown>;
|
|
21
|
+
_prepared: Map<string, unknown>;
|
|
22
|
+
_sequences: Map<string, Record<string, number>>;
|
|
23
|
+
_tempTables: Set<string>;
|
|
24
|
+
_graphStore: GraphStore;
|
|
25
|
+
_versionedGraphs: Map<string, unknown>;
|
|
26
|
+
_pathIndexes: Map<string, PathIndex>;
|
|
27
|
+
_foreignServers: Map<string, ForeignServer>;
|
|
28
|
+
_foreignTables: Map<string, ForeignTable>;
|
|
29
|
+
_models: Map<string, Record<string, unknown>>;
|
|
30
|
+
private _catalog;
|
|
31
|
+
private _indexManager;
|
|
32
|
+
private _transaction;
|
|
33
|
+
private _compiler;
|
|
34
|
+
private _dbPath;
|
|
35
|
+
private _parallelWorkers;
|
|
36
|
+
private _spillThreshold;
|
|
37
|
+
constructor(opts?: EngineOptions);
|
|
38
|
+
sql(query: string, params?: unknown[]): Promise<SQLResult | null>;
|
|
39
|
+
getTable(name: string): Table;
|
|
40
|
+
hasTable(name: string): boolean;
|
|
41
|
+
registerTable(name: string, table: Table): void;
|
|
42
|
+
addDocument(docId: DocId, document: Record<string, unknown>, table: string, embedding?: Float64Array | null): void;
|
|
43
|
+
getDocument(docId: DocId, table: string): Record<string, unknown> | null;
|
|
44
|
+
deleteDocument(docId: DocId, table: string): void;
|
|
45
|
+
getGraphStore(_table: string): GraphStore;
|
|
46
|
+
addGraphVertex(vertex: Vertex, table: string): void;
|
|
47
|
+
addGraphEdge(edge: Edge, table: string): void;
|
|
48
|
+
createGraph(name: string): GraphStore;
|
|
49
|
+
dropGraph(name: string): void;
|
|
50
|
+
getGraph(name: string): GraphStore;
|
|
51
|
+
hasGraph(name: string): boolean;
|
|
52
|
+
get graphStore(): GraphStore;
|
|
53
|
+
estimateConvWeights(table: string, edgeLabel: string, kernelHops: number, embeddingField?: string): number[];
|
|
54
|
+
saveModel(modelName: string, config: Record<string, unknown>): void;
|
|
55
|
+
loadModel(modelName: string): Record<string, unknown> | null;
|
|
56
|
+
deleteModel(modelName: string): void;
|
|
57
|
+
buildPathIndex(graphName: string, labelSequences: string[][]): void;
|
|
58
|
+
getPathIndex(graphName: string): PathIndex | null;
|
|
59
|
+
dropPathIndex(graphName: string): void;
|
|
60
|
+
createAnalyzer(name: string, config: Record<string, unknown>): void;
|
|
61
|
+
dropAnalyzer(name: string): void;
|
|
62
|
+
setTableAnalyzer(tableName: string, field: string, analyzerName: string, phase?: "index" | "search" | "both"): void;
|
|
63
|
+
getTableAnalyzer(tableName: string, field: string, phase?: "index" | "search"): unknown;
|
|
64
|
+
saveScoringParams(name: string, params: Record<string, unknown>): void;
|
|
65
|
+
loadScoringParams(name: string): Record<string, unknown> | null;
|
|
66
|
+
loadAllScoringParams(): [string, Record<string, unknown>][];
|
|
67
|
+
learnScoringParams(table: string, field: string, query: string, labels: number[], opts?: {
|
|
68
|
+
mode?: string;
|
|
69
|
+
}): Record<string, number>;
|
|
70
|
+
updateScoringParams(table: string, field: string, score: number, label: number): void;
|
|
71
|
+
vectorBackgroundStats(table: string, field: string): [number, number] | null;
|
|
72
|
+
begin(): Transaction;
|
|
73
|
+
query(table: string): QueryBuilder;
|
|
74
|
+
insert(table: string, docId: number, document: Record<string, unknown>): void;
|
|
75
|
+
get dbPath(): string | null;
|
|
76
|
+
get parallelWorkers(): number;
|
|
77
|
+
get spillThreshold(): number;
|
|
78
|
+
get compiler(): SQLCompiler;
|
|
79
|
+
get catalog(): Catalog | null;
|
|
80
|
+
get indexManager(): IndexManager | null;
|
|
81
|
+
_contextForTable(tableName: string): ExecutionContext;
|
|
82
|
+
/**
|
|
83
|
+
* Train a deep learning model on the given table data.
|
|
84
|
+
* Returns the trained model configuration.
|
|
85
|
+
*/
|
|
86
|
+
deepLearn(table: string, modelName: string, config: Record<string, unknown>): Record<string, unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* Run inference using a trained deep learning model.
|
|
89
|
+
*/
|
|
90
|
+
deepPredict(modelName: string, inputs: Record<string, unknown>[]): Record<string, unknown>[];
|
|
91
|
+
/**
|
|
92
|
+
* Apply a batch of graph mutations (delta) atomically.
|
|
93
|
+
* Delta format: { addVertices, removeVertices, addEdges, removeEdges }
|
|
94
|
+
*/
|
|
95
|
+
applyGraphDelta(graphName: string, delta: {
|
|
96
|
+
addVertices?: Vertex[];
|
|
97
|
+
removeVertices?: number[];
|
|
98
|
+
addEdges?: Edge[];
|
|
99
|
+
removeEdges?: number[];
|
|
100
|
+
}): void;
|
|
101
|
+
/**
|
|
102
|
+
* Create a versioned snapshot of a graph.
|
|
103
|
+
*/
|
|
104
|
+
createGraphVersion(graphName: string, versionTag: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* List all version tags for a graph.
|
|
107
|
+
*/
|
|
108
|
+
graphVersions(graphName: string): string[];
|
|
109
|
+
/**
|
|
110
|
+
* Restore a graph to a specific version.
|
|
111
|
+
*/
|
|
112
|
+
restoreGraphVersion(graphName: string, versionTag: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Generate a calibration report for scoring parameters.
|
|
115
|
+
* Returns statistics about the calibration quality.
|
|
116
|
+
*/
|
|
117
|
+
calibrationReport(table: string, field: string): Record<string, unknown>;
|
|
118
|
+
/**
|
|
119
|
+
* Save the full engine state to the catalog for persistence.
|
|
120
|
+
* Called automatically when a catalog is available and mutations occur.
|
|
121
|
+
*/
|
|
122
|
+
saveToCatalog(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Load the full engine state from the catalog.
|
|
125
|
+
* Called during initialization when a catalog is available.
|
|
126
|
+
*/
|
|
127
|
+
loadFromCatalog(): void;
|
|
128
|
+
close(): void;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMapping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AAC,MAAM,EAAE,OAAO,CAAC;IAkDxE;;;OAGG;IACH,aAAa,IAAI,IAAI;IA8BrB;;;OAGG;IACH,eAAe,IAAI,IAAI;IAqBvB,KAAK,IAAI,IAAI;CA0Bd"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export type DataType = "integer" | "float" | "text" | "boolean" | "bytes" | "unknown";
|
|
2
|
+
export interface ArrowField {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly type: DataType;
|
|
5
|
+
readonly nullable: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ArrowSchema {
|
|
8
|
+
readonly fields: readonly ArrowField[];
|
|
9
|
+
}
|
|
10
|
+
export declare function arrowSchema(fields: ArrowField[]): ArrowSchema;
|
|
11
|
+
export declare function arrowField(name: string, type: DataType, nullable?: boolean): ArrowField;
|
|
12
|
+
/**
|
|
13
|
+
* ColumnVector wraps a plain JS array with an optional selection vector.
|
|
14
|
+
* When a selection vector is present, only indices listed in the selection
|
|
15
|
+
* vector are logically valid. This avoids copying data during filter operations.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ColumnVector {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly type: DataType;
|
|
20
|
+
private _data;
|
|
21
|
+
private _selection;
|
|
22
|
+
private _logicalLength;
|
|
23
|
+
constructor(name: string, type: DataType, data: unknown[], selection?: number[] | null);
|
|
24
|
+
/** Physical length of the underlying data array. */
|
|
25
|
+
get physicalLength(): number;
|
|
26
|
+
/** Logical length respecting the selection vector. */
|
|
27
|
+
get length(): number;
|
|
28
|
+
/** Whether a selection vector is active. */
|
|
29
|
+
get hasSelection(): boolean;
|
|
30
|
+
/** Access the raw data array (bypasses selection). */
|
|
31
|
+
get rawData(): unknown[];
|
|
32
|
+
/** Access the selection vector, or null if none. */
|
|
33
|
+
get selection(): number[] | null;
|
|
34
|
+
/**
|
|
35
|
+
* Get the value at logical index i.
|
|
36
|
+
* If a selection vector is present, maps through it.
|
|
37
|
+
*/
|
|
38
|
+
get(i: number): unknown;
|
|
39
|
+
/**
|
|
40
|
+
* Return a new ColumnVector with an applied selection vector.
|
|
41
|
+
* The resulting selection vector is composed with any existing selection.
|
|
42
|
+
*/
|
|
43
|
+
withSelection(indices: number[]): ColumnVector;
|
|
44
|
+
/**
|
|
45
|
+
* Compact the column vector by materializing only the selected rows
|
|
46
|
+
* into a new contiguous array. Removes the selection vector.
|
|
47
|
+
*/
|
|
48
|
+
compact(): ColumnVector;
|
|
49
|
+
/**
|
|
50
|
+
* Convert to a plain array respecting selection.
|
|
51
|
+
*/
|
|
52
|
+
toArray(): unknown[];
|
|
53
|
+
/**
|
|
54
|
+
* Create a ColumnVector from a typed Float64Array (for numeric columns).
|
|
55
|
+
*/
|
|
56
|
+
static fromFloat64Array(name: string, arr: Float64Array): ColumnVector;
|
|
57
|
+
/**
|
|
58
|
+
* Create a ColumnVector from a string array.
|
|
59
|
+
*/
|
|
60
|
+
static fromStrings(name: string, arr: string[]): ColumnVector;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Columnar batch: a collection of named columns, each represented as a plain
|
|
64
|
+
* JS array. All columns share the same logical length.
|
|
65
|
+
*/
|
|
66
|
+
export declare class Batch {
|
|
67
|
+
private _columns;
|
|
68
|
+
private _length;
|
|
69
|
+
constructor(data: Map<string, unknown[]>, length: number);
|
|
70
|
+
/**
|
|
71
|
+
* Build a Batch from an array of row objects.
|
|
72
|
+
* If schema is provided, columns are created in schema order; otherwise
|
|
73
|
+
* columns are derived from the union of all row keys.
|
|
74
|
+
*/
|
|
75
|
+
static fromRows(rows: Record<string, unknown>[], schema?: Map<string, DataType>): Batch;
|
|
76
|
+
/** Number of rows in this batch. */
|
|
77
|
+
get length(): number;
|
|
78
|
+
/** Ordered column names. */
|
|
79
|
+
get columnNames(): string[];
|
|
80
|
+
/**
|
|
81
|
+
* Return the column array for the given name.
|
|
82
|
+
* Throws if the column does not exist.
|
|
83
|
+
*/
|
|
84
|
+
column(name: string): unknown[];
|
|
85
|
+
/**
|
|
86
|
+
* Return the column array for the given name, or null if missing.
|
|
87
|
+
*/
|
|
88
|
+
getColumn(name: string): unknown[] | null;
|
|
89
|
+
/**
|
|
90
|
+
* Convert the columnar batch back into an array of row objects.
|
|
91
|
+
*/
|
|
92
|
+
toRows(): Record<string, unknown>[];
|
|
93
|
+
/**
|
|
94
|
+
* Return a new Batch containing rows [offset, offset + length).
|
|
95
|
+
*/
|
|
96
|
+
slice(offset: number, length: number): Batch;
|
|
97
|
+
/**
|
|
98
|
+
* Return a new Batch with only the specified columns, optionally renaming
|
|
99
|
+
* them via the aliases map (original -> alias).
|
|
100
|
+
*/
|
|
101
|
+
selectColumns(columns: string[], aliases?: Map<string, string>): Batch;
|
|
102
|
+
/**
|
|
103
|
+
* Return a new Batch containing only the rows at the given indices.
|
|
104
|
+
*/
|
|
105
|
+
take(indices: number[]): Batch;
|
|
106
|
+
/**
|
|
107
|
+
* Add a new column to this batch (mutating).
|
|
108
|
+
* The array must have the same length as existing columns.
|
|
109
|
+
*/
|
|
110
|
+
addColumn(name: string, data: unknown[]): void;
|
|
111
|
+
/**
|
|
112
|
+
* Remove a column from this batch (mutating).
|
|
113
|
+
*/
|
|
114
|
+
removeColumn(name: string): void;
|
|
115
|
+
/**
|
|
116
|
+
* Rename a column (mutating).
|
|
117
|
+
*/
|
|
118
|
+
renameColumn(oldName: string, newName: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Return true if this batch has a column with the given name.
|
|
121
|
+
*/
|
|
122
|
+
hasColumn(name: string): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Concatenate rows from another batch (same schema assumed).
|
|
125
|
+
*/
|
|
126
|
+
concat(other: Batch): Batch;
|
|
127
|
+
/**
|
|
128
|
+
* Return a new empty Batch with the same column names.
|
|
129
|
+
*/
|
|
130
|
+
empty(): Batch;
|
|
131
|
+
/**
|
|
132
|
+
* Build a Batch from ColumnVector instances.
|
|
133
|
+
*/
|
|
134
|
+
static fromColumnVectors(vectors: ColumnVector[]): Batch;
|
|
135
|
+
/**
|
|
136
|
+
* Convert this Batch to an array of ColumnVector instances.
|
|
137
|
+
*/
|
|
138
|
+
toColumnVectors(): ColumnVector[];
|
|
139
|
+
/**
|
|
140
|
+
* Build an ArrowSchema from this Batch's column types.
|
|
141
|
+
*/
|
|
142
|
+
inferSchema(): ArrowSchema;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../../src/execution/batch.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAMtF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAE7D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,UAAO,GAAG,UAAU,CAEpF;AAMD;;;;GAIG;AACH,qBAAa,YAAY;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,cAAc,CAAS;gBAG7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,OAAO,EAAE,EACf,SAAS,CAAC,EAAE,MAAM,EAA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,OAAO,EAAE;IAQ/B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI;IAIzC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAcnC;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK;IAa5C;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK;IAatE;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK;IAY9B;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAY9C;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAiBpD;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAa3B;;OAEG;IACH,KAAK,IAAI,KAAK;IAQd;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK;IAUxD;;OAEG;IACH,eAAe,IAAI,YAAY,EAAE;IAsBjC;;OAEG;IACH,WAAW,IAAI,WAAW;CAsB3B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Batch } from "./batch.js";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class for Volcano-model physical operators.
|
|
4
|
+
*
|
|
5
|
+
* Each operator implements `open()`, `next()`, and `close()`.
|
|
6
|
+
* - `open()` initializes state (e.g. opens child iterators).
|
|
7
|
+
* - `next()` returns the next Batch, or null when exhausted.
|
|
8
|
+
* - `close()` releases resources.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class PhysicalOperator {
|
|
11
|
+
/** Initialize the operator and its children. */
|
|
12
|
+
abstract open(): void;
|
|
13
|
+
/** Return the next batch of rows, or null if exhausted. */
|
|
14
|
+
abstract next(): Batch | null;
|
|
15
|
+
/** Release all resources. */
|
|
16
|
+
abstract close(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=physical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physical.d.ts","sourceRoot":"","sources":["../../../../src/execution/physical.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;;;GAOG;AACH,8BAAsB,gBAAgB;IACpC,gDAAgD;IAChD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,IAAI,KAAK,GAAG,IAAI;IAE7B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,IAAI,IAAI;CACvB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { Predicate } from "../core/types.js";
|
|
2
|
+
import { ExprEvaluator } from "../sql/expr-evaluator.js";
|
|
3
|
+
import { Batch } from "./batch.js";
|
|
4
|
+
import { PhysicalOperator } from "./physical.js";
|
|
5
|
+
export interface WindowSpec {
|
|
6
|
+
readonly outputCol: string;
|
|
7
|
+
readonly funcName: string;
|
|
8
|
+
readonly partitionBy: string[];
|
|
9
|
+
readonly orderBy: SortKey[];
|
|
10
|
+
readonly inputCol?: string;
|
|
11
|
+
readonly lagLeadOffset?: number;
|
|
12
|
+
readonly lagLeadDefault?: unknown;
|
|
13
|
+
readonly ntileBuckets?: number;
|
|
14
|
+
readonly frameStart?: string | null;
|
|
15
|
+
readonly frameEnd?: string | null;
|
|
16
|
+
readonly frameStartOffset?: number;
|
|
17
|
+
readonly frameEndOffset?: number;
|
|
18
|
+
readonly frameType?: string;
|
|
19
|
+
readonly filterNode?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export declare class FilterOp extends PhysicalOperator {
|
|
22
|
+
private readonly _child;
|
|
23
|
+
private readonly _column;
|
|
24
|
+
private readonly _predicate;
|
|
25
|
+
constructor(child: PhysicalOperator, column: string, predicate: Predicate);
|
|
26
|
+
open(): void;
|
|
27
|
+
next(): Batch | null;
|
|
28
|
+
close(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class ExprFilterOp extends PhysicalOperator {
|
|
31
|
+
private readonly _child;
|
|
32
|
+
private readonly _exprNode;
|
|
33
|
+
private readonly _evaluator;
|
|
34
|
+
constructor(child: PhysicalOperator, exprNode: Record<string, unknown>, evaluator?: ExprEvaluator);
|
|
35
|
+
open(): void;
|
|
36
|
+
next(): Batch | null;
|
|
37
|
+
close(): void;
|
|
38
|
+
}
|
|
39
|
+
export declare class ProjectOp extends PhysicalOperator {
|
|
40
|
+
private readonly _child;
|
|
41
|
+
private readonly _columns;
|
|
42
|
+
private readonly _aliases;
|
|
43
|
+
constructor(child: PhysicalOperator, columns: string[], aliases?: Map<string, string>);
|
|
44
|
+
open(): void;
|
|
45
|
+
next(): Batch | null;
|
|
46
|
+
close(): void;
|
|
47
|
+
}
|
|
48
|
+
export interface ExprProjectSpec {
|
|
49
|
+
readonly outputCol: string;
|
|
50
|
+
readonly exprNode: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export declare class ExprProjectOp extends PhysicalOperator {
|
|
53
|
+
private readonly _child;
|
|
54
|
+
private readonly _specs;
|
|
55
|
+
private readonly _evaluator;
|
|
56
|
+
constructor(child: PhysicalOperator, specs: ExprProjectSpec[], evaluator?: ExprEvaluator);
|
|
57
|
+
open(): void;
|
|
58
|
+
next(): Batch | null;
|
|
59
|
+
/**
|
|
60
|
+
* Attempt vectorized column copy for simple ColumnRef-only projections.
|
|
61
|
+
* Returns null if any spec is not a simple column reference.
|
|
62
|
+
*/
|
|
63
|
+
private _tryVectorized;
|
|
64
|
+
/**
|
|
65
|
+
* Extract a simple column name from a ColumnRef AST node.
|
|
66
|
+
* Returns null if the node is not a simple ColumnRef.
|
|
67
|
+
*/
|
|
68
|
+
private _extractColumnName;
|
|
69
|
+
close(): void;
|
|
70
|
+
}
|
|
71
|
+
export interface SortKey {
|
|
72
|
+
readonly column: string;
|
|
73
|
+
readonly ascending: boolean;
|
|
74
|
+
readonly nullsFirst: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare class SortOp extends PhysicalOperator {
|
|
77
|
+
private readonly _child;
|
|
78
|
+
private readonly _sortKeys;
|
|
79
|
+
private _sorted;
|
|
80
|
+
private _index;
|
|
81
|
+
private readonly _batchSize;
|
|
82
|
+
private readonly _spillThreshold;
|
|
83
|
+
private _spillManager;
|
|
84
|
+
constructor(child: PhysicalOperator, sortKeys: SortKey[], batchSize?: number, spillThreshold?: number);
|
|
85
|
+
open(): void;
|
|
86
|
+
/**
|
|
87
|
+
* External merge sort: read child in chunks of _spillThreshold rows,
|
|
88
|
+
* sort each chunk in memory, spill to SpillManager, then k-way merge
|
|
89
|
+
* all sorted runs.
|
|
90
|
+
*/
|
|
91
|
+
private _externalMergeSort;
|
|
92
|
+
next(): Batch | null;
|
|
93
|
+
close(): void;
|
|
94
|
+
static _sortRows(rows: Record<string, unknown>[], sortKeys: SortKey[]): void;
|
|
95
|
+
private _compare;
|
|
96
|
+
}
|
|
97
|
+
export declare class LimitOp extends PhysicalOperator {
|
|
98
|
+
private readonly _child;
|
|
99
|
+
private readonly _limit;
|
|
100
|
+
private readonly _offset;
|
|
101
|
+
private _emitted;
|
|
102
|
+
private _skipped;
|
|
103
|
+
constructor(child: PhysicalOperator, limit: number, offset?: number);
|
|
104
|
+
open(): void;
|
|
105
|
+
next(): Batch | null;
|
|
106
|
+
close(): void;
|
|
107
|
+
}
|
|
108
|
+
export interface AggregateSpec {
|
|
109
|
+
readonly outputCol: string;
|
|
110
|
+
readonly funcName: string;
|
|
111
|
+
readonly inputCol?: string;
|
|
112
|
+
readonly distinct?: boolean;
|
|
113
|
+
readonly extra?: unknown;
|
|
114
|
+
readonly filterNode?: Record<string, unknown>;
|
|
115
|
+
readonly orderKeys?: [string, boolean][];
|
|
116
|
+
}
|
|
117
|
+
export declare class HashAggOp extends PhysicalOperator {
|
|
118
|
+
private readonly _child;
|
|
119
|
+
private readonly _groupByCols;
|
|
120
|
+
private readonly _aggSpecs;
|
|
121
|
+
private readonly _groupAliases;
|
|
122
|
+
private _result;
|
|
123
|
+
private _index;
|
|
124
|
+
private readonly _batchSize;
|
|
125
|
+
private readonly _spillThreshold;
|
|
126
|
+
private _filterEvaluator;
|
|
127
|
+
private static readonly NUM_PARTITIONS;
|
|
128
|
+
constructor(child: PhysicalOperator, groupByCols: string[], aggSpecs: AggregateSpec[], opts?: {
|
|
129
|
+
batchSize?: number;
|
|
130
|
+
groupAliases?: Map<string, string>;
|
|
131
|
+
spillThreshold?: number;
|
|
132
|
+
});
|
|
133
|
+
open(): void;
|
|
134
|
+
/**
|
|
135
|
+
* 16-partition spill strategy for large aggregations.
|
|
136
|
+
* Hash-partition rows into 16 buckets, aggregate each bucket independently,
|
|
137
|
+
* then combine results.
|
|
138
|
+
*/
|
|
139
|
+
private _aggregateWithSpill;
|
|
140
|
+
/**
|
|
141
|
+
* Simple string hash for partitioning.
|
|
142
|
+
*/
|
|
143
|
+
private static _hashString;
|
|
144
|
+
private _canStream;
|
|
145
|
+
private _aggregateStreaming;
|
|
146
|
+
private _aggregateMaterialized;
|
|
147
|
+
next(): Batch | null;
|
|
148
|
+
close(): void;
|
|
149
|
+
}
|
|
150
|
+
export declare class DistinctOp extends PhysicalOperator {
|
|
151
|
+
private readonly _child;
|
|
152
|
+
private readonly _columns;
|
|
153
|
+
private readonly _spillThreshold;
|
|
154
|
+
private _seen;
|
|
155
|
+
private _spillPartitions;
|
|
156
|
+
private static readonly NUM_PARTITIONS;
|
|
157
|
+
constructor(child: PhysicalOperator, columns: string[], spillThreshold?: number);
|
|
158
|
+
open(): void;
|
|
159
|
+
next(): Batch | null;
|
|
160
|
+
private static _hashKey;
|
|
161
|
+
close(): void;
|
|
162
|
+
}
|
|
163
|
+
export declare class WindowOp extends PhysicalOperator {
|
|
164
|
+
private readonly _child;
|
|
165
|
+
private readonly _windowSpecs;
|
|
166
|
+
private _result;
|
|
167
|
+
private _index;
|
|
168
|
+
private readonly _batchSize;
|
|
169
|
+
constructor(child: PhysicalOperator, windowSpecs: WindowSpec[], batchSize?: number);
|
|
170
|
+
open(): void;
|
|
171
|
+
next(): Batch | null;
|
|
172
|
+
close(): void;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=relational.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relational.d.ts","sourceRoot":"","sources":["../../../../src/execution/relational.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQjD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,G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AC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAM;gBAEhC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,cAAc,SAAI;IAO1E,IAAI,IAAI,IAAI;IAMZ,IAAI,IAAI,KAAK,GAAG,IAAI;IAmDpB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAQvB,KAAK,IAAI,IAAI;CAKd;AAMD,qBAAa,QAAS,SAAQ,gBAAgB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,SAAS,SAAO;IAOhF,IAAI,IAAI,IAAI;IAiFZ,IAAI,IAAI,KAAK,GAAG,IAAI;IAQpB,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { PostingList } from "../core/posting-list.js";
|
|
2
|
+
import type { DocumentStore } from "../storage/abc/document-store.js";
|
|
3
|
+
import { Batch } from "./batch.js";
|
|
4
|
+
import { PhysicalOperator } from "./physical.js";
|
|
5
|
+
export declare class SeqScanOp extends PhysicalOperator {
|
|
6
|
+
private readonly _store;
|
|
7
|
+
private readonly _columns;
|
|
8
|
+
private _iterator;
|
|
9
|
+
private _batchSize;
|
|
10
|
+
/**
|
|
11
|
+
* @param store The document store to scan.
|
|
12
|
+
* @param columns If provided, only these columns are emitted.
|
|
13
|
+
* null means all columns present in the document.
|
|
14
|
+
* @param batchSize Number of rows per batch (default 1024).
|
|
15
|
+
*/
|
|
16
|
+
constructor(store: DocumentStore, columns?: string[] | null, batchSize?: number);
|
|
17
|
+
open(): void;
|
|
18
|
+
next(): Batch | null;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class PostingListScanOp extends PhysicalOperator {
|
|
22
|
+
private readonly _postingList;
|
|
23
|
+
private readonly _store;
|
|
24
|
+
private readonly _columns;
|
|
25
|
+
private _index;
|
|
26
|
+
private _batchSize;
|
|
27
|
+
/**
|
|
28
|
+
* @param postingList The posting list to scan.
|
|
29
|
+
* @param store If provided, row fields are enriched from the
|
|
30
|
+
* document store. Otherwise only docId and score
|
|
31
|
+
* are emitted.
|
|
32
|
+
* @param columns If provided with a store, only these columns are
|
|
33
|
+
* fetched.
|
|
34
|
+
* @param batchSize Number of rows per batch (default 1024).
|
|
35
|
+
*/
|
|
36
|
+
constructor(postingList: PostingList, store?: DocumentStore | null, columns?: string[] | null, batchSize?: number);
|
|
37
|
+
open(): void;
|
|
38
|
+
next(): Batch | null;
|
|
39
|
+
close(): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../src/execution/scan.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMjD,qBAAa,SAAU,SAAQ,gBAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,SAAS,CAAmE;IACpF,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;;OAKG;gBACS,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,SAAS,SAAO;IAO7E,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,KAAK,GAAG,IAAI;IA6BpB,KAAK,IAAI,IAAI;CAGd;AAOD,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;;;;;OAQG;gBAED,WAAW,EAAE,WAAW,EACxB,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,EAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EACzB,SAAS,SAAO;IASlB,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,KAAK,GAAG,IAAI;IAoDpB,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare class SpillManager {
|
|
2
|
+
private _runs;
|
|
3
|
+
/** Allocate a new run buffer. Returns the run index. */
|
|
4
|
+
newRun(): number;
|
|
5
|
+
/** Return a new SpillWriter backed by a new run. */
|
|
6
|
+
newWriter(): SpillWriter;
|
|
7
|
+
/** Append rows to an existing run. */
|
|
8
|
+
writeRows(runIdx: number, rows: Record<string, unknown>[]): void;
|
|
9
|
+
/** Read all rows from a run. */
|
|
10
|
+
readRows(runIdx: number): Record<string, unknown>[];
|
|
11
|
+
/** Return the number of runs. */
|
|
12
|
+
get runCount(): number;
|
|
13
|
+
/** Release all spill memory. */
|
|
14
|
+
cleanup(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare class SpillWriter {
|
|
17
|
+
private _manager;
|
|
18
|
+
private _runIdx;
|
|
19
|
+
private _rowCount;
|
|
20
|
+
constructor(manager: SpillManager, runIdx: number);
|
|
21
|
+
get runIdx(): number;
|
|
22
|
+
get rowCount(): number;
|
|
23
|
+
writeRows(rows: Record<string, unknown>[]): void;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Merge multiple pre-sorted runs into a single sorted array.
|
|
28
|
+
*
|
|
29
|
+
* Uses a simple k-way merge with a linear scan to find the minimum at each
|
|
30
|
+
* step. For the expected number of runs (typically 2-8), this is efficient
|
|
31
|
+
* enough; a heap-based approach can be added for very large k values.
|
|
32
|
+
*
|
|
33
|
+
* @param runs Array of sorted run arrays.
|
|
34
|
+
* @param sortKeys Array of [column, ascending] pairs.
|
|
35
|
+
* @returns Merged sorted array.
|
|
36
|
+
*/
|
|
37
|
+
export type SortKeySpec = [string, boolean] | [string, boolean, boolean];
|
|
38
|
+
export declare function mergeSortedRuns(runs: Record<string, unknown>[][], sortKeys: SortKeySpec[]): Record<string, unknown>[];
|
|
39
|
+
//# sourceMappingURL=spill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spill.d.ts","sourceRoot":"","sources":["../../../../src/execution/spill.ts"],"names":[],"mappings":"AAoBA,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAmC;IAEhD,wDAAwD;IACxD,MAAM,IAAI,MAAM;IAMhB,oDAAoD;IACpD,SAAS,IAAI,WAAW;IAKxB,sCAAsC;IACtC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI;IAUhE,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAQnD,iCAAiC;IACjC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,gCAAgC;IAChC,OAAO,IAAI,IAAI;CAGhB;AAMD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;gBAEd,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAMjD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI;IAMhD,KAAK,IAAI,IAAI;CAGd;AAMD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEzE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,EACjC,QAAQ,EAAE,WAAW,EAAE,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAiC3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FDWPredicate } from "./handler.js";
|
|
2
|
+
import { FDWHandler } from "./handler.js";
|
|
3
|
+
import type { ForeignServer } from "./foreign-table.js";
|
|
4
|
+
import type { ForeignTable } from "./foreign-table.js";
|
|
5
|
+
export declare class ArrowFDWHandler extends FDWHandler {
|
|
6
|
+
private _server;
|
|
7
|
+
private _cachedData;
|
|
8
|
+
private _arrowLib;
|
|
9
|
+
constructor(server: ForeignServer);
|
|
10
|
+
get server(): ForeignServer;
|
|
11
|
+
/**
|
|
12
|
+
* Attempt to load the apache-arrow library dynamically.
|
|
13
|
+
*/
|
|
14
|
+
private _loadArrowLib;
|
|
15
|
+
/**
|
|
16
|
+
* Convert Arrow table/RecordBatch to plain row objects.
|
|
17
|
+
*/
|
|
18
|
+
private _arrowTableToRows;
|
|
19
|
+
/**
|
|
20
|
+
* Load data from the Arrow source specified in server options.
|
|
21
|
+
* Supports 'data' option (JSON-encoded rows for testing) and
|
|
22
|
+
* 'buffer' option (base64-encoded Arrow IPC buffer).
|
|
23
|
+
*/
|
|
24
|
+
private _loadData;
|
|
25
|
+
scan(foreignTable: ForeignTable, columns?: string[] | null, predicates?: FDWPredicate[] | null, limit?: number | null): Record<string, unknown>[];
|
|
26
|
+
close(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=arrow-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-handler.d.ts","sourceRoot":"","sources":["../../../../src/fdw/arrow-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA4EvD,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,WAAW,CAAmC;IACtD,OAAO,CAAC,SAAS,CAAU;gBAEf,MAAM,EAAE,aAAa;IAOjC,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAmCjB,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EACzB,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,EAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAK5B,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FDWPredicate } from "./handler.js";
|
|
2
|
+
import { FDWHandler } from "./handler.js";
|
|
3
|
+
import type { ForeignServer } from "./foreign-table.js";
|
|
4
|
+
import type { ForeignTable } from "./foreign-table.js";
|
|
5
|
+
export declare class DuckDBFDWHandler extends FDWHandler {
|
|
6
|
+
private _server;
|
|
7
|
+
private _db;
|
|
8
|
+
private _conn;
|
|
9
|
+
private _duckdbLib;
|
|
10
|
+
constructor(server: ForeignServer);
|
|
11
|
+
get server(): ForeignServer;
|
|
12
|
+
/**
|
|
13
|
+
* Attempt to load @duckdb/duckdb-wasm dynamically.
|
|
14
|
+
*/
|
|
15
|
+
private _loadDuckDB;
|
|
16
|
+
/**
|
|
17
|
+
* Build the SQL query string with pushdown predicates, column projection, and limit.
|
|
18
|
+
*/
|
|
19
|
+
private _buildQuery;
|
|
20
|
+
/**
|
|
21
|
+
* Convert DuckDB query result to plain row objects.
|
|
22
|
+
*/
|
|
23
|
+
private _resultToRows;
|
|
24
|
+
scan(foreignTable: ForeignTable, columns?: string[] | null, predicates?: FDWPredicate[] | null, limit?: number | null): Record<string, unknown>[];
|
|
25
|
+
/**
|
|
26
|
+
* Initialize the DuckDB WASM connection asynchronously.
|
|
27
|
+
* Must be called before scan() when using actual DuckDB.
|
|
28
|
+
*/
|
|
29
|
+
initAsync(): Promise<void>;
|
|
30
|
+
close(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=duckdb-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duckdb-handler.d.ts","sourceRoot":"","sources":["../../../../src/fdw/duckdb-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAkEvD,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,UAAU,CAAU;gBAEhB,MAAM,EAAE,aAAa;IAQjC,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED;;OAEG;IACH,OAAO,CAAC,WAAW;IAWnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAkBnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAmCrB,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EACzB,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,EAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IA0E5B;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAqChC,KAAK,IAAI,IAAI;CAiBd"}
|