@slexisvn/query-engine 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/dist/binder/binder.d.ts +130 -0
- package/dist/binder/expression-binder.d.ts +168 -0
- package/dist/binder/scope.d.ts +40 -0
- package/dist/browser.d.ts +8 -0
- package/dist/catalog/catalog.d.ts +53 -0
- package/dist/catalog/function-registry.d.ts +26 -0
- package/dist/catalog/statistics-cache.d.ts +39 -0
- package/dist/catalog/statistics.d.ts +72 -0
- package/dist/catalog/tpch-schema.d.ts +15 -0
- package/dist/cli/cli-common.d.ts +11 -0
- package/dist/cli/coordinator.d.ts +1 -0
- package/dist/cli/format.d.ts +8 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/loaders/csv-loader.d.ts +17 -0
- package/dist/cli/loaders/data-loader.d.ts +7 -0
- package/dist/cli/loaders/json-loader.d.ts +13 -0
- package/dist/cli/loaders/loader-factory.d.ts +4 -0
- package/dist/cli/repl.d.ts +6 -0
- package/dist/cli/worker.d.ts +1 -0
- package/dist/config.d.ts +42 -0
- package/dist/core.wasm +0 -0
- package/dist/dataframe/column-expr.d.ts +67 -0
- package/dist/dataframe/dataframe.d.ts +96 -0
- package/dist/dataframe/expr-types.d.ts +6 -0
- package/dist/dataframe/in-memory-relation.d.ts +31 -0
- package/dist/dataframe/index.d.ts +4 -0
- package/dist/dataframe/schema.d.ts +35 -0
- package/dist/dataframe/sql-expr-binder.d.ts +17 -0
- package/dist/dataframe/type-inference.d.ts +8 -0
- package/dist/distributed/cluster/cluster-manager.d.ts +54 -0
- package/dist/distributed/cluster/heartbeat-monitor.d.ts +27 -0
- package/dist/distributed/cluster/node-descriptor.d.ts +41 -0
- package/dist/distributed/distributed-types.d.ts +336 -0
- package/dist/distributed/execution/coordinator.d.ts +53 -0
- package/dist/distributed/execution/exchange-operator.d.ts +44 -0
- package/dist/distributed/execution/fragment-executor.d.ts +48 -0
- package/dist/distributed/execution/merge-exchange.d.ts +55 -0
- package/dist/distributed/optimizer/distributed-sort.d.ts +6 -0
- package/dist/distributed/optimizer/distribution-aware-join.d.ts +28 -0
- package/dist/distributed/optimizer/partial-aggregate.d.ts +9 -0
- package/dist/distributed/partition/partition-map.d.ts +27 -0
- package/dist/distributed/partition/partition-pruner.d.ts +33 -0
- package/dist/distributed/partition/partition-strategy.d.ts +43 -0
- package/dist/distributed/planner/distributed-planner.d.ts +71 -0
- package/dist/distributed/planner/exchange-placement.d.ts +19 -0
- package/dist/distributed/planner/expr-utils.d.ts +2 -0
- package/dist/distributed/planner/fragment.d.ts +47 -0
- package/dist/distributed/transport/chunk-codec.d.ts +18 -0
- package/dist/distributed/transport/http-transport.d.ts +49 -0
- package/dist/distributed/transport/transport.d.ts +13 -0
- package/dist/engine/query-engine.d.ts +142 -0
- package/dist/engine-entry.d.ts +12 -0
- package/dist/execution/builders/aggregate-builder.d.ts +46 -0
- package/dist/execution/builders/builder-utils.d.ts +5 -0
- package/dist/execution/builders/cte-builders.d.ts +20 -0
- package/dist/execution/builders/exchange-builders.d.ts +33 -0
- package/dist/execution/builders/join-builder.d.ts +67 -0
- package/dist/execution/builders/pipeline-builders.d.ts +30 -0
- package/dist/execution/builders/source-builders.d.ts +23 -0
- package/dist/execution/column-resolve.d.ts +7 -0
- package/dist/execution/execution-types.d.ts +33 -0
- package/dist/execution/expression-eval.d.ts +13 -0
- package/dist/execution/fragment-spec.d.ts +125 -0
- package/dist/execution/join-utils.d.ts +14 -0
- package/dist/execution/operator-registry.d.ts +9 -0
- package/dist/execution/operators/agg-wasm.d.ts +16 -0
- package/dist/execution/operators/dedup-core.d.ts +10 -0
- package/dist/execution/operators/dependent-join.d.ts +14 -0
- package/dist/execution/operators/distinct.d.ts +12 -0
- package/dist/execution/operators/filter.d.ts +87 -0
- package/dist/execution/operators/hash-aggregate.d.ts +121 -0
- package/dist/execution/operators/hash-join.d.ts +74 -0
- package/dist/execution/operators/index-scan.d.ts +34 -0
- package/dist/execution/operators/join-core.d.ts +47 -0
- package/dist/execution/operators/merge-join.d.ts +38 -0
- package/dist/execution/operators/nested-loop-join.d.ts +28 -0
- package/dist/execution/operators/projection.d.ts +20 -0
- package/dist/execution/operators/scan.d.ts +17 -0
- package/dist/execution/operators/sort.d.ts +48 -0
- package/dist/execution/operators/stream-aggregate.d.ts +30 -0
- package/dist/execution/operators/union.d.ts +13 -0
- package/dist/execution/operators/vector-aggregate.d.ts +73 -0
- package/dist/execution/operators/window.d.ts +22 -0
- package/dist/execution/physical-plan.d.ts +14 -0
- package/dist/execution/pipeline.d.ts +28 -0
- package/dist/execution/query-executor.d.ts +70 -0
- package/dist/execution/query-result.d.ts +15 -0
- package/dist/execution/result-sink.d.ts +26 -0
- package/dist/execution/scheduler.d.ts +8 -0
- package/dist/execution/vector-ops.d.ts +32 -0
- package/dist/execution/wasm-expr-eval.d.ts +7 -0
- package/dist/index.browser.js +17999 -0
- package/dist/index.cli.js +1002 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.node.js +21432 -0
- package/dist/optimizer/dphyp/cardinality.d.ts +69 -0
- package/dist/optimizer/dphyp/cost-model.d.ts +47 -0
- package/dist/optimizer/dphyp/dphyp.d.ts +32 -0
- package/dist/optimizer/dphyp/hypergraph.d.ts +38 -0
- package/dist/optimizer/optimizer.d.ts +12 -0
- package/dist/optimizer/pass.d.ts +5 -0
- package/dist/optimizer/passes/aggregate-pushdown.d.ts +6 -0
- package/dist/optimizer/passes/cte-optimization.d.ts +6 -0
- package/dist/optimizer/passes/empty-propagation.d.ts +6 -0
- package/dist/optimizer/passes/expr-walk.d.ts +20 -0
- package/dist/optimizer/passes/expression-simplifier.d.ts +8 -0
- package/dist/optimizer/passes/filter-ordering.d.ts +13 -0
- package/dist/optimizer/passes/having-pushdown.d.ts +6 -0
- package/dist/optimizer/passes/index-selection.d.ts +24 -0
- package/dist/optimizer/passes/join-elimination.d.ts +6 -0
- package/dist/optimizer/passes/join-reorder.d.ts +12 -0
- package/dist/optimizer/passes/join-residual-split.d.ts +6 -0
- package/dist/optimizer/passes/limit-pushdown.d.ts +6 -0
- package/dist/optimizer/passes/node-merge.d.ts +6 -0
- package/dist/optimizer/passes/outer-to-inner.d.ts +6 -0
- package/dist/optimizer/passes/physical-design.d.ts +12 -0
- package/dist/optimizer/passes/plan-refs.d.ts +22 -0
- package/dist/optimizer/passes/predicate-dedup.d.ts +6 -0
- package/dist/optimizer/passes/predicate-inference.d.ts +6 -0
- package/dist/optimizer/passes/predicate-pushdown.d.ts +9 -0
- package/dist/optimizer/passes/projection-pushdown.d.ts +6 -0
- package/dist/optimizer/passes/sort-elimination.d.ts +6 -0
- package/dist/optimizer/passes/subquery-unnesting.d.ts +6 -0
- package/dist/optimizer/passes/topn-fusion.d.ts +6 -0
- package/dist/parallel/chunk-transport.d.ts +24 -0
- package/dist/parallel/fragment-pool.d.ts +49 -0
- package/dist/parallel/fragment-worker.d.ts +1 -0
- package/dist/parallel/morsel-scheduler.d.ts +11 -0
- package/dist/parallel/parallel-dispatch.d.ts +69 -0
- package/dist/parallel/partial-spill.d.ts +3 -0
- package/dist/parallel/worker-messages.d.ts +243 -0
- package/dist/parallel/worker-pool.d.ts +62 -0
- package/dist/parallel/worker-thread.d.ts +1 -0
- package/dist/parser/ast.d.ts +298 -0
- package/dist/parser/lexer.d.ts +135 -0
- package/dist/parser/parser.d.ts +64 -0
- package/dist/planner/logical-plan.d.ts +250 -0
- package/dist/planner/logical-planner.d.ts +23 -0
- package/dist/planner/plan-formatter.d.ts +4 -0
- package/dist/planner/plan-visitor.d.ts +58 -0
- package/dist/runtime/platform.d.ts +4 -0
- package/dist/storage/backend/memory-storage-backend.d.ts +14 -0
- package/dist/storage/backend/node-storage-backend.d.ts +11 -0
- package/dist/storage/btree.d.ts +34 -0
- package/dist/storage/buffer-pool.d.ts +17 -0
- package/dist/storage/chunk.d.ts +26 -0
- package/dist/storage/column.d.ts +38 -0
- package/dist/storage/data-type.d.ts +54 -0
- package/dist/storage/dictionary-column.d.ts +33 -0
- package/dist/storage/page-store/file-page-store.d.ts +13 -0
- package/dist/storage/page-store/memory-page-store.d.ts +9 -0
- package/dist/storage/sab-arena.d.ts +26 -0
- package/dist/storage/serializer.d.ts +6 -0
- package/dist/storage/spill-manager/fs-storage.d.ts +11 -0
- package/dist/storage/spill-manager/memory-storage.d.ts +10 -0
- package/dist/storage/spill-manager/spill-manager.d.ts +17 -0
- package/dist/storage/storage-constants.d.ts +3 -0
- package/dist/storage/table.d.ts +31 -0
- package/dist/storage/temp-space/memory-temp-space.d.ts +11 -0
- package/dist/storage/temp-space/temp-directory-manager.d.ts +14 -0
- package/dist/utils/bitmap.d.ts +11 -0
- package/dist/utils/hash.d.ts +1 -0
- package/dist/utils/lru-cache.d.ts +24 -0
- package/dist/utils/priority-queue.d.ts +18 -0
- package/dist/wasm/dispatch.d.ts +13 -0
- package/dist/wasm/fetch-byte-source.d.ts +2 -0
- package/dist/wasm/kernels/core-instance.d.ts +6 -0
- package/dist/wasm/kernels/kernel-factory.d.ts +8 -0
- package/dist/wasm/kernels/wasm-aggregate.d.ts +6 -0
- package/dist/wasm/kernels/wasm-arithmetic.d.ts +13 -0
- package/dist/wasm/kernels/wasm-filter-f64.d.ts +8 -0
- package/dist/wasm/kernels/wasm-filter.d.ts +5 -0
- package/dist/wasm/loader.d.ts +17 -0
- package/dist/wasm/node-byte-source.d.ts +1 -0
- package/dist/wasm/region-allocator.d.ts +23 -0
- package/dist/wasm/register-kernels.d.ts +1 -0
- package/dist/wasm/wasm-loader-base.d.ts +33 -0
- package/dist/wasm/wasm-types.d.ts +103 -0
- package/package.json +60 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type * as AST from '../parser/ast.js';
|
|
2
|
+
import { BinderScope, type ColumnInfo } from './scope.js';
|
|
3
|
+
import * as BE from './expression-binder.js';
|
|
4
|
+
export interface TableMeta {
|
|
5
|
+
name: string;
|
|
6
|
+
columns: ColumnInfo[];
|
|
7
|
+
}
|
|
8
|
+
export interface CatalogLike {
|
|
9
|
+
getTable(name: string): TableMeta | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface OutputColumn {
|
|
12
|
+
name: string;
|
|
13
|
+
expr: BE.BoundExpr;
|
|
14
|
+
dataType: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface BoundSelectItem {
|
|
17
|
+
expr: BE.BoundExpr;
|
|
18
|
+
alias: string | null;
|
|
19
|
+
inferredName: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface BoundOrderKey {
|
|
22
|
+
expr: BE.BoundExpr;
|
|
23
|
+
direction: string;
|
|
24
|
+
nullOrder: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface BoundTableRef {
|
|
27
|
+
type: 'TableRef';
|
|
28
|
+
tableName: string;
|
|
29
|
+
alias: string;
|
|
30
|
+
columns: ColumnInfo[];
|
|
31
|
+
}
|
|
32
|
+
export interface BoundCTERef {
|
|
33
|
+
type: 'CTERef';
|
|
34
|
+
cteName: string;
|
|
35
|
+
alias: string;
|
|
36
|
+
columns: ColumnInfo[];
|
|
37
|
+
query: BoundQuery;
|
|
38
|
+
}
|
|
39
|
+
export interface BoundJoinRef {
|
|
40
|
+
type: 'JoinRef';
|
|
41
|
+
joinType: string;
|
|
42
|
+
left: BoundFrom;
|
|
43
|
+
right: BoundFrom;
|
|
44
|
+
condition: BE.BoundExpr | null;
|
|
45
|
+
}
|
|
46
|
+
export interface BoundSubqueryRef {
|
|
47
|
+
type: 'SubqueryRef';
|
|
48
|
+
alias: string;
|
|
49
|
+
query: BoundQuery;
|
|
50
|
+
columns: OutputColumn[];
|
|
51
|
+
}
|
|
52
|
+
export type BoundFrom = BoundTableRef | BoundCTERef | BoundJoinRef | BoundSubqueryRef;
|
|
53
|
+
export interface BoundSelect {
|
|
54
|
+
type: 'BoundSelect';
|
|
55
|
+
plan: BoundFrom | null;
|
|
56
|
+
selectItems: BoundSelectItem[];
|
|
57
|
+
where: BE.BoundExpr | null;
|
|
58
|
+
groupBy: BE.BoundExpr[] | null;
|
|
59
|
+
aggregates: BE.BoundExpr[];
|
|
60
|
+
having: BE.BoundExpr | null;
|
|
61
|
+
orderBy: BoundOrderKey[] | null;
|
|
62
|
+
limit: BE.BoundExpr | null;
|
|
63
|
+
offset: BE.BoundExpr | null;
|
|
64
|
+
distinct: boolean;
|
|
65
|
+
outputColumns: OutputColumn[];
|
|
66
|
+
}
|
|
67
|
+
export interface BoundSetOp {
|
|
68
|
+
type: 'SetOp';
|
|
69
|
+
op: string;
|
|
70
|
+
all: boolean;
|
|
71
|
+
left: BoundQuery;
|
|
72
|
+
right: BoundQuery;
|
|
73
|
+
outputColumns: OutputColumn[];
|
|
74
|
+
}
|
|
75
|
+
export type BoundQuery = BoundSelect | BoundSetOp;
|
|
76
|
+
interface CteInfo {
|
|
77
|
+
name: string;
|
|
78
|
+
columns: ColumnInfo[];
|
|
79
|
+
bound: BoundQuery;
|
|
80
|
+
}
|
|
81
|
+
interface JoinSide {
|
|
82
|
+
type?: string;
|
|
83
|
+
columns?: ColumnInfo[];
|
|
84
|
+
alias?: string;
|
|
85
|
+
tableName?: string;
|
|
86
|
+
cteName?: string;
|
|
87
|
+
}
|
|
88
|
+
export declare class Binder {
|
|
89
|
+
catalog: CatalogLike;
|
|
90
|
+
functionRegistry: object;
|
|
91
|
+
cteScopes: Map<string, CteInfo>;
|
|
92
|
+
aggregatesFound: BE.BoundExpr[];
|
|
93
|
+
constructor(catalog: CatalogLike, functionRegistry: object);
|
|
94
|
+
bind(ast: AST.QueryStmt): BoundQuery;
|
|
95
|
+
bindQuery(node: AST.QueryStmt, scope: BinderScope): BoundQuery;
|
|
96
|
+
bindSetOp(node: AST.SetOpNode, scope: BinderScope): BoundSetOp;
|
|
97
|
+
bindSelect(node: AST.SelectStmtNode, scope: BinderScope): BoundSelect;
|
|
98
|
+
bindKeyWithAlias(expr: AST.Expr, scope: BinderScope, selectAliasMap: Map<string, BE.BoundExpr>): BE.BoundExpr;
|
|
99
|
+
bindWithClause(withClause: AST.WithClauseNode, scope: BinderScope): void;
|
|
100
|
+
bindFrom(node: AST.FromItem, scope: BinderScope): BoundFrom;
|
|
101
|
+
bindTableRef(node: AST.TableRefNode, scope: BinderScope): BoundTableRef | BoundCTERef;
|
|
102
|
+
bindJoinRef(node: AST.JoinRefNode, scope: BinderScope): BoundJoinRef;
|
|
103
|
+
buildNaturalJoinCondition(left: BoundFrom, right: BoundFrom, scope: BinderScope): BE.BoundExpr | null;
|
|
104
|
+
buildUsingCondition(columnNames: string[], left: BoundFrom, right: BoundFrom, scope: BinderScope): BE.BoundExpr | null;
|
|
105
|
+
getRefColumnNames(ref: JoinSide): string[];
|
|
106
|
+
getRefAlias(ref: JoinSide): string | null;
|
|
107
|
+
bindSubqueryRef(node: AST.SubqueryRefNode, scope: BinderScope): BoundSubqueryRef;
|
|
108
|
+
bindSelectItems(items: AST.SelectItemNode[], scope: BinderScope): BoundSelectItem[];
|
|
109
|
+
expandStar(node: AST.AllColumnsNode, scope: BinderScope): BoundSelectItem[];
|
|
110
|
+
bindExpression(node: AST.Expr | AST.QuantifiedSubqueryNode, scope: BinderScope): BE.BoundExpr;
|
|
111
|
+
bindWindowCall(node: AST.WindowCallNode, scope: BinderScope): BE.BoundWindowNode;
|
|
112
|
+
bindColumnRef(node: AST.ColumnRefNode, scope: BinderScope): BE.BoundColumnRefNode;
|
|
113
|
+
bindLiteral(node: AST.LiteralNode): BE.BoundLiteralNode;
|
|
114
|
+
bindBinaryExpr(node: AST.BinaryExprNode, scope: BinderScope): BE.BoundBinaryNode;
|
|
115
|
+
bindUnaryExpr(node: AST.UnaryExprNode, scope: BinderScope): BE.BoundUnaryNode;
|
|
116
|
+
bindAggregateCall(node: AST.AggregateCallNode, scope: BinderScope): BE.BoundAggregateNode;
|
|
117
|
+
bindFunctionCall(node: AST.FunctionCallNode, scope: BinderScope): BE.BoundFunctionNode;
|
|
118
|
+
bindCaseExpr(node: AST.CaseExprNode, scope: BinderScope): BE.BoundCaseNode;
|
|
119
|
+
bindCastExpr(node: AST.CastExprNode, scope: BinderScope): BE.BoundCastNode;
|
|
120
|
+
bindInExpr(node: AST.InExprNode, scope: BinderScope): BE.BoundInListNode;
|
|
121
|
+
bindExistsExpr(node: AST.ExistsExprNode, scope: BinderScope): BE.BoundExistsNode;
|
|
122
|
+
bindSubqueryExpr(node: AST.SubqueryExprNode, scope: BinderScope): BE.BoundSubqueryNode;
|
|
123
|
+
inferColumnName(node: AST.Expr): string | null;
|
|
124
|
+
inferArithmeticType(left: string | null, right: string | null): string;
|
|
125
|
+
inferAggregateType(name: string, args: BE.BoundExpr[]): string;
|
|
126
|
+
inferFunctionType(name: string, args: BE.BoundExpr[]): string | null;
|
|
127
|
+
inferWindowType(name: string, args: BE.BoundExpr[]): string | null;
|
|
128
|
+
resolveTypeName(typeName: AST.TypeNameNode): string;
|
|
129
|
+
}
|
|
130
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { BoundQuery } from './binder.js';
|
|
2
|
+
export type LiteralValue = string | number | boolean | bigint | null;
|
|
3
|
+
export declare enum BoundExprKind {
|
|
4
|
+
COLUMN_REF = "BoundColumnRef",
|
|
5
|
+
LITERAL = "BoundLiteral",
|
|
6
|
+
BINARY = "BoundBinary",
|
|
7
|
+
UNARY = "BoundUnary",
|
|
8
|
+
FUNCTION = "BoundFunction",
|
|
9
|
+
AGGREGATE = "BoundAggregate",
|
|
10
|
+
CASE = "BoundCase",
|
|
11
|
+
CAST = "BoundCast",
|
|
12
|
+
BETWEEN = "BoundBetween",
|
|
13
|
+
IN_LIST = "BoundInList",
|
|
14
|
+
LIKE = "BoundLike",
|
|
15
|
+
IS_NULL = "BoundIsNull",
|
|
16
|
+
SUBQUERY = "BoundSubquery",
|
|
17
|
+
EXISTS = "BoundExists",
|
|
18
|
+
EXTRACT = "BoundExtract",
|
|
19
|
+
INTERVAL = "BoundInterval",
|
|
20
|
+
COMPARISON = "BoundComparison",
|
|
21
|
+
WINDOW = "BoundWindow"
|
|
22
|
+
}
|
|
23
|
+
export type BoundExpr = BoundColumnRefNode | BoundLiteralNode | BoundBinaryNode | BoundUnaryNode | BoundFunctionNode | BoundAggregateNode | BoundCaseNode | BoundCastNode | BoundBetweenNode | BoundInListNode | BoundLikeNode | BoundIsNullNode | BoundSubqueryNode | BoundExistsNode | BoundExtractNode | BoundIntervalNode | BoundWindowNode;
|
|
24
|
+
export interface BoundWhenClause {
|
|
25
|
+
condition: BoundExpr;
|
|
26
|
+
result: BoundExpr;
|
|
27
|
+
}
|
|
28
|
+
export interface BoundWindowOrderKey {
|
|
29
|
+
expr: BoundExpr;
|
|
30
|
+
direction?: string;
|
|
31
|
+
nullOrder?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export interface BoundColumnRefNode {
|
|
34
|
+
kind: BoundExprKind.COLUMN_REF;
|
|
35
|
+
tableAlias: string;
|
|
36
|
+
columnName: string;
|
|
37
|
+
columnIndex: number;
|
|
38
|
+
dataType: string | null;
|
|
39
|
+
depth: number;
|
|
40
|
+
isCorrelated: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface BoundLiteralNode {
|
|
43
|
+
kind: BoundExprKind.LITERAL;
|
|
44
|
+
value: LiteralValue;
|
|
45
|
+
dataType: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface BoundBinaryNode {
|
|
48
|
+
kind: BoundExprKind.BINARY;
|
|
49
|
+
op: string;
|
|
50
|
+
left: BoundExpr;
|
|
51
|
+
right: BoundExpr;
|
|
52
|
+
resultType: string;
|
|
53
|
+
}
|
|
54
|
+
export interface BoundUnaryNode {
|
|
55
|
+
kind: BoundExprKind.UNARY;
|
|
56
|
+
op: string;
|
|
57
|
+
operand: BoundExpr;
|
|
58
|
+
resultType: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface BoundFunctionNode {
|
|
61
|
+
kind: BoundExprKind.FUNCTION;
|
|
62
|
+
name: string;
|
|
63
|
+
args: BoundExpr[];
|
|
64
|
+
resultType: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface BoundAggregateNode {
|
|
67
|
+
kind: BoundExprKind.AGGREGATE;
|
|
68
|
+
name: string;
|
|
69
|
+
args: BoundExpr[];
|
|
70
|
+
distinct: boolean;
|
|
71
|
+
resultType: string;
|
|
72
|
+
}
|
|
73
|
+
export interface BoundCaseNode {
|
|
74
|
+
kind: BoundExprKind.CASE;
|
|
75
|
+
operand: BoundExpr | null;
|
|
76
|
+
whenClauses: BoundWhenClause[];
|
|
77
|
+
elseExpr: BoundExpr | null;
|
|
78
|
+
resultType: string;
|
|
79
|
+
}
|
|
80
|
+
export interface BoundCastNode {
|
|
81
|
+
kind: BoundExprKind.CAST;
|
|
82
|
+
expr: BoundExpr;
|
|
83
|
+
targetType: string;
|
|
84
|
+
dataType: string;
|
|
85
|
+
}
|
|
86
|
+
export interface BoundBetweenNode {
|
|
87
|
+
kind: BoundExprKind.BETWEEN;
|
|
88
|
+
expr: BoundExpr;
|
|
89
|
+
low: BoundExpr;
|
|
90
|
+
high: BoundExpr;
|
|
91
|
+
negated: boolean;
|
|
92
|
+
resultType: string;
|
|
93
|
+
}
|
|
94
|
+
export interface BoundInListNode {
|
|
95
|
+
kind: BoundExprKind.IN_LIST;
|
|
96
|
+
expr: BoundExpr;
|
|
97
|
+
list: BoundExpr | BoundExpr[];
|
|
98
|
+
negated: boolean;
|
|
99
|
+
resultType: string;
|
|
100
|
+
}
|
|
101
|
+
export interface BoundLikeNode {
|
|
102
|
+
kind: BoundExprKind.LIKE;
|
|
103
|
+
expr: BoundExpr;
|
|
104
|
+
pattern: BoundExpr;
|
|
105
|
+
negated: boolean;
|
|
106
|
+
resultType: string;
|
|
107
|
+
}
|
|
108
|
+
export interface BoundIsNullNode {
|
|
109
|
+
kind: BoundExprKind.IS_NULL;
|
|
110
|
+
expr: BoundExpr;
|
|
111
|
+
negated: boolean;
|
|
112
|
+
resultType: string;
|
|
113
|
+
}
|
|
114
|
+
export interface BoundSubqueryNode {
|
|
115
|
+
kind: BoundExprKind.SUBQUERY;
|
|
116
|
+
plan: BoundQuery;
|
|
117
|
+
subqueryType: string;
|
|
118
|
+
}
|
|
119
|
+
export interface BoundExistsNode {
|
|
120
|
+
kind: BoundExprKind.EXISTS;
|
|
121
|
+
plan: BoundQuery;
|
|
122
|
+
negated: boolean;
|
|
123
|
+
resultType: string;
|
|
124
|
+
}
|
|
125
|
+
export interface BoundExtractNode {
|
|
126
|
+
kind: BoundExprKind.EXTRACT;
|
|
127
|
+
field: string;
|
|
128
|
+
source: BoundExpr;
|
|
129
|
+
resultType: string;
|
|
130
|
+
}
|
|
131
|
+
export interface BoundIntervalNode {
|
|
132
|
+
kind: BoundExprKind.INTERVAL;
|
|
133
|
+
value: number;
|
|
134
|
+
unit: string;
|
|
135
|
+
resultType: string;
|
|
136
|
+
}
|
|
137
|
+
export interface BoundWindowNode {
|
|
138
|
+
kind: BoundExprKind.WINDOW;
|
|
139
|
+
name: string;
|
|
140
|
+
args: BoundExpr[];
|
|
141
|
+
partitionBy: BoundExpr[];
|
|
142
|
+
orderBy: BoundWindowOrderKey[];
|
|
143
|
+
resultType: string | null;
|
|
144
|
+
}
|
|
145
|
+
export declare function BoundColumnRef(tableAlias: string, columnName: string, columnIndex: number, dataType: string | null, depth?: number): BoundColumnRefNode;
|
|
146
|
+
export declare function BoundLiteral(value: LiteralValue, dataType: string | null): BoundLiteralNode;
|
|
147
|
+
export declare function BoundBinary(op: string, left: BoundExpr, right: BoundExpr, resultType: string): BoundBinaryNode;
|
|
148
|
+
export declare function BoundUnary(op: string, operand: BoundExpr, resultType: string | null): BoundUnaryNode;
|
|
149
|
+
export declare function BoundFunction(name: string, args: BoundExpr[], resultType: string | null): BoundFunctionNode;
|
|
150
|
+
export declare function BoundAggregate(name: string, args: BoundExpr[], distinct: boolean, resultType: string): BoundAggregateNode;
|
|
151
|
+
export declare function BoundCase(operand: BoundExpr | null, whenClauses: BoundWhenClause[], elseExpr: BoundExpr | null, resultType: string): BoundCaseNode;
|
|
152
|
+
export declare function BoundCast(expr: BoundExpr, targetType: string): BoundCastNode;
|
|
153
|
+
export declare function BoundBetween(expr: BoundExpr, low: BoundExpr, high: BoundExpr, negated: boolean): BoundBetweenNode;
|
|
154
|
+
export declare function BoundInList(expr: BoundExpr, list: BoundExpr | BoundExpr[], negated: boolean): BoundInListNode;
|
|
155
|
+
export declare function BoundLike(expr: BoundExpr, pattern: BoundExpr, negated: boolean): BoundLikeNode;
|
|
156
|
+
export declare function BoundIsNull(expr: BoundExpr, negated: boolean): BoundIsNullNode;
|
|
157
|
+
export declare function BoundSubquery(plan: BoundQuery, subqueryType: string): BoundSubqueryNode;
|
|
158
|
+
export declare function BoundExists(plan: BoundQuery, negated: boolean): BoundExistsNode;
|
|
159
|
+
export declare function BoundExtract(field: string, source: BoundExpr): BoundExtractNode;
|
|
160
|
+
export declare function BoundInterval(value: number, unit: string): BoundIntervalNode;
|
|
161
|
+
export declare function BoundWindow(name: string, args: BoundExpr[], partitionBy: BoundExpr[], orderBy: BoundWindowOrderKey[], resultType: string | null): BoundWindowNode;
|
|
162
|
+
export declare function getExprType(expr?: {
|
|
163
|
+
kind?: BoundExprKind;
|
|
164
|
+
resultType?: string | null;
|
|
165
|
+
dataType?: string | null;
|
|
166
|
+
} | null): string | null;
|
|
167
|
+
export declare function collectCorrelatedColumns(expr: BoundExpr): BoundColumnRefNode[];
|
|
168
|
+
export declare function walkExpr(expr: BoundExpr | null | undefined, fn: (node: BoundExpr) => void): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ColumnInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
dataType: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface TableInfo {
|
|
6
|
+
originalName: string;
|
|
7
|
+
columns: ColumnInfo[];
|
|
8
|
+
isCTE?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedTable {
|
|
11
|
+
table: TableInfo;
|
|
12
|
+
depth: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ResolvedColumn {
|
|
15
|
+
tableAlias: string;
|
|
16
|
+
tableName: string;
|
|
17
|
+
column: ColumnInfo;
|
|
18
|
+
columnIndex: number;
|
|
19
|
+
depth: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ColumnEntry {
|
|
22
|
+
tableAlias: string;
|
|
23
|
+
tableName: string;
|
|
24
|
+
column: ColumnInfo;
|
|
25
|
+
columnIndex: number;
|
|
26
|
+
}
|
|
27
|
+
export declare class BinderScope {
|
|
28
|
+
parent: BinderScope | null;
|
|
29
|
+
tables: Map<string, TableInfo>;
|
|
30
|
+
columns: Map<string, ColumnInfo[]>;
|
|
31
|
+
correlatedRefs: never[];
|
|
32
|
+
constructor(parent?: BinderScope | null);
|
|
33
|
+
addTable(alias: string, tableInfo: TableInfo): void;
|
|
34
|
+
addColumn(alias: string, columnInfo: ColumnInfo): void;
|
|
35
|
+
resolveTable(name: string): ResolvedTable | null;
|
|
36
|
+
resolveColumn(name: string, tableAlias?: string | null): ResolvedColumn | null;
|
|
37
|
+
getAllColumns(): ColumnEntry[];
|
|
38
|
+
getTableColumns(tableAlias: string): ColumnEntry[] | null;
|
|
39
|
+
child(): BinderScope;
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QueryEngine } from './engine/query-engine.js';
|
|
2
|
+
import { setWasmBaseUrl } from './wasm/fetch-byte-source.js';
|
|
3
|
+
import { Catalog } from './catalog/catalog.js';
|
|
4
|
+
import { DataType } from './storage/data-type.js';
|
|
5
|
+
import { InMemoryRelation, RelationBuilder } from './dataframe/in-memory-relation.js';
|
|
6
|
+
export { QueryEngine, Catalog, DataType, InMemoryRelation, RelationBuilder, setWasmBaseUrl };
|
|
7
|
+
export { DataFrame, GroupedData, Col, col, lit, expr, sum, avg, min, max, count, countStar, } from './dataframe/index.js';
|
|
8
|
+
export { createEngine, registerTable, registerStreamingTable } from './engine-entry.js';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ColumnSchema } from '../storage/data-type.js';
|
|
2
|
+
import type { Table } from '../storage/table.js';
|
|
3
|
+
import type { BTreeIndex } from '../storage/btree.js';
|
|
4
|
+
export interface ForeignKeySchema {
|
|
5
|
+
columns: string[];
|
|
6
|
+
refTable: string;
|
|
7
|
+
refColumns: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface CatalogTableOptions {
|
|
10
|
+
primaryKey?: string[];
|
|
11
|
+
foreignKeys?: ForeignKeySchema[];
|
|
12
|
+
}
|
|
13
|
+
export interface CatalogTable {
|
|
14
|
+
name: string;
|
|
15
|
+
columns: ColumnSchema[];
|
|
16
|
+
primaryKey: string[];
|
|
17
|
+
foreignKeys: ForeignKeySchema[];
|
|
18
|
+
}
|
|
19
|
+
export interface IndexEntry {
|
|
20
|
+
tableName: string;
|
|
21
|
+
columnName: string;
|
|
22
|
+
btree: BTreeIndex;
|
|
23
|
+
}
|
|
24
|
+
export interface PartitionStrategyLike {
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
27
|
+
export type PartitionKeyLike = string | string[] | Map<string, number>;
|
|
28
|
+
export interface PartitionInfo {
|
|
29
|
+
strategy: PartitionStrategyLike;
|
|
30
|
+
partitionCount: number;
|
|
31
|
+
partitionKey: PartitionKeyLike;
|
|
32
|
+
}
|
|
33
|
+
export declare class Catalog {
|
|
34
|
+
tables: Map<string, CatalogTable>;
|
|
35
|
+
tableStorage: Map<string, Table>;
|
|
36
|
+
indexes: Map<string, IndexEntry>;
|
|
37
|
+
partitionInfo: Map<string, PartitionInfo>;
|
|
38
|
+
constructor();
|
|
39
|
+
registerTable(name: string, schema: ColumnSchema[], options?: CatalogTableOptions): void;
|
|
40
|
+
registerTableStorage(name: string, storage: Table): void;
|
|
41
|
+
getTable(name: string): CatalogTable | null;
|
|
42
|
+
getTableStorage(name: string): Table | null;
|
|
43
|
+
getColumn(tableName: string, columnName: string): ColumnSchema | null;
|
|
44
|
+
getColumnIndex(tableName: string, columnName: string): number;
|
|
45
|
+
dropTable(name: string): void;
|
|
46
|
+
hasTable(name: string): boolean;
|
|
47
|
+
listTables(): string[];
|
|
48
|
+
registerIndex(tableName: string, columnName: string, btree: BTreeIndex): void;
|
|
49
|
+
getIndexForColumn(tableName: string, columnName: string): BTreeIndex | null;
|
|
50
|
+
getIndexesForTable(tableName: string): IndexEntry[];
|
|
51
|
+
registerPartitionInfo(tableName: string, strategy: PartitionStrategyLike, partitionCount: number, partitionKey: PartitionKeyLike): void;
|
|
52
|
+
getPartitionInfo(tableName: string): PartitionInfo | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ColumnValue, DataType } from '../storage/data-type.js';
|
|
2
|
+
export declare enum FunctionType {
|
|
3
|
+
SCALAR = "SCALAR",
|
|
4
|
+
AGGREGATE = "AGGREGATE"
|
|
5
|
+
}
|
|
6
|
+
export type FunctionImpl = (args: ColumnValue[]) => ColumnValue;
|
|
7
|
+
export interface FunctionDef {
|
|
8
|
+
name: string;
|
|
9
|
+
type: FunctionType;
|
|
10
|
+
minArgs: number;
|
|
11
|
+
maxArgs: number;
|
|
12
|
+
argTypes?: DataType[];
|
|
13
|
+
returnType?: DataType;
|
|
14
|
+
impl?: FunctionImpl;
|
|
15
|
+
}
|
|
16
|
+
export declare class FunctionRegistry {
|
|
17
|
+
functions: Map<string, FunctionDef>;
|
|
18
|
+
constructor();
|
|
19
|
+
register(name: string, definition: FunctionDef): void;
|
|
20
|
+
lookup(name: string): FunctionDef | null;
|
|
21
|
+
has(name: string): boolean;
|
|
22
|
+
isAggregate(name: string): boolean;
|
|
23
|
+
isScalar(name: string): boolean;
|
|
24
|
+
_registerBuiltins(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const defaultFunctionRegistry: FunctionRegistry;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TableStatistics } from './statistics.js';
|
|
2
|
+
import type { ColumnSchema, ColumnValue } from '../storage/data-type.js';
|
|
3
|
+
interface TableStorageLike {
|
|
4
|
+
rowCount(): number;
|
|
5
|
+
getSchema(): ColumnSchema[];
|
|
6
|
+
getColumnIndex(name: string): number;
|
|
7
|
+
scan(): AsyncIterable<{
|
|
8
|
+
size: number;
|
|
9
|
+
getValue(row: number, col: number): ColumnValue;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
interface CatalogLike {
|
|
13
|
+
getTableStorage(name: string): TableStorageLike | null;
|
|
14
|
+
listTables(): string[];
|
|
15
|
+
}
|
|
16
|
+
interface CacheEntry {
|
|
17
|
+
stats: TableStatistics;
|
|
18
|
+
version: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class StatisticsCache {
|
|
21
|
+
catalog: CatalogLike;
|
|
22
|
+
cache: Map<string, CacheEntry>;
|
|
23
|
+
versions: Map<string, number>;
|
|
24
|
+
constructor(catalog: CatalogLike);
|
|
25
|
+
get(tableName: string): TableStatistics | undefined;
|
|
26
|
+
has(tableName: string): boolean;
|
|
27
|
+
set(tableName: string, stats: TableStatistics): void;
|
|
28
|
+
ensure(tableName: string): Promise<TableStatistics | undefined>;
|
|
29
|
+
ensureAll(): Promise<void>;
|
|
30
|
+
invalidate(tableName: string): void;
|
|
31
|
+
invalidateAll(): void;
|
|
32
|
+
getVersion(key: string): number;
|
|
33
|
+
get size(): number;
|
|
34
|
+
values(): Generator<TableStatistics>;
|
|
35
|
+
entries(): Generator<[string, TableStatistics]>;
|
|
36
|
+
[Symbol.iterator](): Generator<[string, TableStatistics]>;
|
|
37
|
+
toMap(): Map<string, TableStatistics>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ColumnValue, type ColumnSchema } from '../storage/data-type.js';
|
|
2
|
+
export interface Mcv {
|
|
3
|
+
values: (string | number)[];
|
|
4
|
+
frequencies: number[];
|
|
5
|
+
}
|
|
6
|
+
export interface ColumnStatisticsInit {
|
|
7
|
+
ndv?: number;
|
|
8
|
+
min?: ColumnValue;
|
|
9
|
+
max?: ColumnValue;
|
|
10
|
+
nullFraction?: number;
|
|
11
|
+
histogram?: EquiDepthHistogram | null;
|
|
12
|
+
mcv?: Mcv | null;
|
|
13
|
+
avgWidth?: number;
|
|
14
|
+
avgLength?: number | null;
|
|
15
|
+
}
|
|
16
|
+
export interface HistogramBucketInfo {
|
|
17
|
+
boundaries: ColumnValue[];
|
|
18
|
+
bucketCounts: number[] | null;
|
|
19
|
+
bucketDistincts: number[] | null;
|
|
20
|
+
}
|
|
21
|
+
export declare class ColumnStatistics {
|
|
22
|
+
ndv: number;
|
|
23
|
+
min: ColumnValue;
|
|
24
|
+
max: ColumnValue;
|
|
25
|
+
nullFraction: number;
|
|
26
|
+
histogram: EquiDepthHistogram | null;
|
|
27
|
+
mcv: Mcv | null;
|
|
28
|
+
avgWidth: number;
|
|
29
|
+
avgLength: number | null;
|
|
30
|
+
constructor({ ndv, min, max, nullFraction, histogram, mcv, avgWidth, avgLength }?: ColumnStatisticsInit);
|
|
31
|
+
}
|
|
32
|
+
export declare class TableStatistics {
|
|
33
|
+
rowCount: number;
|
|
34
|
+
columnStats: Map<string, ColumnStatistics>;
|
|
35
|
+
correlations: Map<string, number>;
|
|
36
|
+
constructor(rowCount: number, columnStats?: Map<string, ColumnStatistics>, correlations?: Map<string, number>);
|
|
37
|
+
getColumnStats(columnName: string): ColumnStatistics | null;
|
|
38
|
+
setColumnStats(columnName: string, stats: ColumnStatistics): void;
|
|
39
|
+
_correlationKey(colA: string, colB: string): string;
|
|
40
|
+
getCorrelation(colA: string, colB: string): number | null;
|
|
41
|
+
setCorrelation(colA: string, colB: string, value: number): void;
|
|
42
|
+
get avgRowWidth(): number;
|
|
43
|
+
}
|
|
44
|
+
export declare class EquiDepthHistogram {
|
|
45
|
+
boundaries: ColumnValue[];
|
|
46
|
+
numBuckets: number;
|
|
47
|
+
numRows: number;
|
|
48
|
+
rowsPerBucket: number;
|
|
49
|
+
bucketCounts: number[] | null;
|
|
50
|
+
bucketDistincts: number[] | null;
|
|
51
|
+
totalCount: number | null;
|
|
52
|
+
constructor(boundaries: ColumnValue[], numRows: number, bucketCounts?: number[] | null, bucketDistincts?: number[] | null);
|
|
53
|
+
bucketInfo(): HistogramBucketInfo;
|
|
54
|
+
estimateLessThan(value: ColumnValue): number;
|
|
55
|
+
estimateRange(low: ColumnValue, high: ColumnValue): number;
|
|
56
|
+
}
|
|
57
|
+
export interface TableStatsSource {
|
|
58
|
+
rowCount(): number;
|
|
59
|
+
getSchema(): ColumnSchema[];
|
|
60
|
+
getColumnIndex(name: string): number;
|
|
61
|
+
scan(): AsyncIterable<{
|
|
62
|
+
size: number;
|
|
63
|
+
getValue(row: number, col: number): ColumnValue;
|
|
64
|
+
}>;
|
|
65
|
+
}
|
|
66
|
+
export declare class StatisticsCollector {
|
|
67
|
+
static collect(table: TableStatsSource): Promise<TableStatistics>;
|
|
68
|
+
static _collectColumn(table: TableStatsSource, colDef: ColumnSchema, totalRows: number): Promise<ColumnStatistics>;
|
|
69
|
+
static _buildHistogram(values: ColumnValue[], totalRows: number): EquiDepthHistogram;
|
|
70
|
+
static _buildMCV(valueCounts: Map<string, number>, nonNullCount: number): Mcv | null;
|
|
71
|
+
static _computeCorrelations: (table: TableStatsSource, columnStats: Map<string, ColumnStatistics>) => Promise<Map<string, number>>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ColumnSchema } from '../storage/data-type.js';
|
|
2
|
+
import { Catalog } from './catalog.js';
|
|
3
|
+
interface ForeignKeySchema {
|
|
4
|
+
columns: string[];
|
|
5
|
+
refTable: string;
|
|
6
|
+
refColumns: string[];
|
|
7
|
+
}
|
|
8
|
+
interface TableSchema {
|
|
9
|
+
columns: ColumnSchema[];
|
|
10
|
+
primaryKey: string[];
|
|
11
|
+
foreignKeys?: ForeignKeySchema[];
|
|
12
|
+
}
|
|
13
|
+
export declare const TPCH_TABLES: Record<string, TableSchema>;
|
|
14
|
+
export declare function createTPCHCatalog(): Catalog;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Catalog, QueryEngine } from '../index.js';
|
|
2
|
+
interface LoadDataFilesOptions {
|
|
3
|
+
loadOptions?: object;
|
|
4
|
+
formatLoadLine?: (context: {
|
|
5
|
+
tableName: string;
|
|
6
|
+
rowCount: number;
|
|
7
|
+
dataPath: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadDataFiles(engine: QueryEngine, catalog: Catalog, dataPaths: string[], options?: LoadDataFilesOptions): Promise<void>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function start(): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ColumnSchema, ColumnValue, QueryEngine } from '../../index.js';
|
|
2
|
+
import { DataLoader } from './data-loader.js';
|
|
3
|
+
interface CSVLoadOptions {
|
|
4
|
+
partitionIndex?: number | null;
|
|
5
|
+
partitionCount?: number | null;
|
|
6
|
+
maxRows?: number | null;
|
|
7
|
+
}
|
|
8
|
+
type CSVRow = Record<string, string>;
|
|
9
|
+
export declare class CSVLoader extends DataLoader {
|
|
10
|
+
allowedDir: string | null;
|
|
11
|
+
constructor(allowedDir?: string | null);
|
|
12
|
+
validatePath(filePath: string): string;
|
|
13
|
+
load(engine: QueryEngine, filePath: string, options?: CSVLoadOptions): Promise<string>;
|
|
14
|
+
inferSchema(firstRow: CSVRow): ColumnSchema[];
|
|
15
|
+
convertRow(rowObj: CSVRow, schema: ColumnSchema[]): ColumnValue[];
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataType } from '../../index.js';
|
|
2
|
+
import type { ColumnSchema, QueryEngine, Table } from '../../index.js';
|
|
3
|
+
export declare class DataLoader {
|
|
4
|
+
load(engine: QueryEngine, filePath: string): Promise<string>;
|
|
5
|
+
registerToCatalog(engine: QueryEngine, tableName: string, schema: ColumnSchema[], table: Table): void;
|
|
6
|
+
buildSchema<T>(firstRow: Record<string, T>, classify: (value: T) => DataType): ColumnSchema[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ColumnSchema, QueryEngine } from '../../index.js';
|
|
2
|
+
import { DataLoader } from './data-loader.js';
|
|
3
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
4
|
+
[key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
type JsonObject = {
|
|
7
|
+
[key: string]: JsonValue;
|
|
8
|
+
};
|
|
9
|
+
export declare class JSONLoader extends DataLoader {
|
|
10
|
+
load(engine: QueryEngine, filePath: string): Promise<string>;
|
|
11
|
+
inferSchema(firstRow: JsonObject): ColumnSchema[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|