@quereus/quereus 4.8.0 → 4.10.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/src/core/database.d.ts +6 -0
- package/dist/src/core/database.d.ts.map +1 -1
- package/dist/src/core/database.js +45 -5
- package/dist/src/core/database.js.map +1 -1
- package/dist/src/core/statement.d.ts.map +1 -1
- package/dist/src/core/statement.js +74 -15
- package/dist/src/core/statement.js.map +1 -1
- package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
- package/dist/src/func/builtins/aggregate.js +88 -35
- package/dist/src/func/builtins/aggregate.js.map +1 -1
- package/dist/src/func/builtins/conversion.d.ts +5 -0
- package/dist/src/func/builtins/conversion.d.ts.map +1 -1
- package/dist/src/func/builtins/conversion.js +16 -2
- package/dist/src/func/builtins/conversion.js.map +1 -1
- package/dist/src/func/builtins/explain.d.ts.map +1 -1
- package/dist/src/func/builtins/explain.js +9 -2
- package/dist/src/func/builtins/explain.js.map +1 -1
- package/dist/src/func/builtins/index.d.ts.map +1 -1
- package/dist/src/func/builtins/index.js +5 -2
- package/dist/src/func/builtins/index.js.map +1 -1
- package/dist/src/func/builtins/scalar.d.ts.map +1 -1
- package/dist/src/func/builtins/scalar.js +4 -2
- package/dist/src/func/builtins/scalar.js.map +1 -1
- package/dist/src/func/builtins/string.d.ts +2 -0
- package/dist/src/func/builtins/string.d.ts.map +1 -1
- package/dist/src/func/builtins/string.js +60 -4
- package/dist/src/func/builtins/string.js.map +1 -1
- package/dist/src/func/registration.d.ts +6 -0
- package/dist/src/func/registration.d.ts.map +1 -1
- package/dist/src/func/registration.js +1 -0
- package/dist/src/func/registration.js.map +1 -1
- package/dist/src/index.d.ts +7 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +21 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/planner/building/constraint-builder.js +1 -1
- package/dist/src/planner/building/constraint-builder.js.map +1 -1
- package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
- package/dist/src/planner/nodes/scalar.js +13 -1
- package/dist/src/planner/nodes/scalar.js.map +1 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.d.ts.map +1 -1
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js +121 -51
- package/dist/src/planner/rules/retrieve/rule-grow-retrieve.js.map +1 -1
- package/dist/src/planner/rules/shared/index-style-context.d.ts +14 -4
- package/dist/src/planner/rules/shared/index-style-context.d.ts.map +1 -1
- package/dist/src/planner/rules/shared/index-style-context.js +14 -4
- package/dist/src/planner/rules/shared/index-style-context.js.map +1 -1
- package/dist/src/runtime/emission-context.d.ts +14 -1
- package/dist/src/runtime/emission-context.d.ts.map +1 -1
- package/dist/src/runtime/emission-context.js +17 -5
- package/dist/src/runtime/emission-context.js.map +1 -1
- package/dist/src/runtime/emit/aggregate-setup.d.ts +44 -8
- package/dist/src/runtime/emit/aggregate-setup.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate-setup.js +79 -15
- package/dist/src/runtime/emit/aggregate-setup.js.map +1 -1
- package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate.js +21 -106
- package/dist/src/runtime/emit/aggregate.js.map +1 -1
- package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-table.js +212 -155
- package/dist/src/runtime/emit/alter-table.js.map +1 -1
- package/dist/src/runtime/emit/asof-scan.js +1 -1
- package/dist/src/runtime/emit/asof-scan.js.map +1 -1
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts +26 -12
- package/dist/src/runtime/emit/assertion-drop-guard.d.ts.map +1 -1
- package/dist/src/runtime/emit/assertion-drop-guard.js +45 -26
- package/dist/src/runtime/emit/assertion-drop-guard.js.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts +6 -6
- package/dist/src/runtime/emit/assertion-rename-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/assertion-rename-helpers.js +18 -20
- package/dist/src/runtime/emit/assertion-rename-helpers.js.map +1 -1
- package/dist/src/runtime/emit/between.d.ts +2 -0
- package/dist/src/runtime/emit/between.d.ts.map +1 -1
- package/dist/src/runtime/emit/between.js +7 -8
- package/dist/src/runtime/emit/between.js.map +1 -1
- package/dist/src/runtime/emit/binary.d.ts +27 -5
- package/dist/src/runtime/emit/binary.d.ts.map +1 -1
- package/dist/src/runtime/emit/binary.js +278 -187
- package/dist/src/runtime/emit/binary.js.map +1 -1
- package/dist/src/runtime/emit/case.d.ts +34 -0
- package/dist/src/runtime/emit/case.d.ts.map +1 -1
- package/dist/src/runtime/emit/case.js +18 -11
- package/dist/src/runtime/emit/case.js.map +1 -1
- package/dist/src/runtime/emit/cast.d.ts +2 -0
- package/dist/src/runtime/emit/cast.d.ts.map +1 -1
- package/dist/src/runtime/emit/cast.js +7 -5
- package/dist/src/runtime/emit/cast.js.map +1 -1
- package/dist/src/runtime/emit/column-reference.d.ts +3 -1
- package/dist/src/runtime/emit/column-reference.d.ts.map +1 -1
- package/dist/src/runtime/emit/column-reference.js +6 -2
- package/dist/src/runtime/emit/column-reference.js.map +1 -1
- package/dist/src/runtime/emit/column-rename-cascade.d.ts +84 -0
- package/dist/src/runtime/emit/column-rename-cascade.d.ts.map +1 -0
- package/dist/src/runtime/emit/column-rename-cascade.js +134 -0
- package/dist/src/runtime/emit/column-rename-cascade.js.map +1 -0
- package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
- package/dist/src/runtime/emit/dml-executor.js +21 -0
- package/dist/src/runtime/emit/dml-executor.js.map +1 -1
- package/dist/src/runtime/emit/drop-column-guards.d.ts +82 -53
- package/dist/src/runtime/emit/drop-column-guards.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-column-guards.js +155 -90
- package/dist/src/runtime/emit/drop-column-guards.js.map +1 -1
- package/dist/src/runtime/emit/drop-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-table.js +5 -0
- package/dist/src/runtime/emit/drop-table.js.map +1 -1
- package/dist/src/runtime/emit/drop-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/drop-view.js +5 -0
- package/dist/src/runtime/emit/drop-view.js.map +1 -1
- package/dist/src/runtime/emit/expression-drop-guard.d.ts +57 -0
- package/dist/src/runtime/emit/expression-drop-guard.d.ts.map +1 -0
- package/dist/src/runtime/emit/expression-drop-guard.js +82 -0
- package/dist/src/runtime/emit/expression-drop-guard.js.map +1 -0
- package/dist/src/runtime/emit/filter.d.ts +1 -1
- package/dist/src/runtime/emit/filter.js +1 -1
- package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.js +18 -88
- package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
- package/dist/src/runtime/emit/literal.d.ts +14 -1
- package/dist/src/runtime/emit/literal.d.ts.map +1 -1
- package/dist/src/runtime/emit/literal.js +33 -7
- package/dist/src/runtime/emit/literal.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts +33 -10
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.js +158 -49
- package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view.js +3 -0
- package/dist/src/runtime/emit/materialized-view.js.map +1 -1
- package/dist/src/runtime/emit/parameter.d.ts +3 -1
- package/dist/src/runtime/emit/parameter.d.ts.map +1 -1
- package/dist/src/runtime/emit/parameter.js +7 -2
- package/dist/src/runtime/emit/parameter.js.map +1 -1
- package/dist/src/runtime/emit/scalar-function.d.ts +29 -1
- package/dist/src/runtime/emit/scalar-function.d.ts.map +1 -1
- package/dist/src/runtime/emit/scalar-function.js +66 -16
- package/dist/src/runtime/emit/scalar-function.js.map +1 -1
- package/dist/src/runtime/emit/scalar-op.d.ts +63 -0
- package/dist/src/runtime/emit/scalar-op.d.ts.map +1 -0
- package/dist/src/runtime/emit/scalar-op.js +37 -0
- package/dist/src/runtime/emit/scalar-op.js.map +1 -0
- package/dist/src/runtime/emit/scan.d.ts.map +1 -1
- package/dist/src/runtime/emit/scan.js +19 -1
- package/dist/src/runtime/emit/scan.js.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts +18 -8
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.js +29 -311
- package/dist/src/runtime/emit/temporal-arithmetic.js.map +1 -1
- package/dist/src/runtime/emit/unary.d.ts +2 -0
- package/dist/src/runtime/emit/unary.d.ts.map +1 -1
- package/dist/src/runtime/emit/unary.js +125 -53
- package/dist/src/runtime/emit/unary.js.map +1 -1
- package/dist/src/runtime/emitters.d.ts +22 -0
- package/dist/src/runtime/emitters.d.ts.map +1 -1
- package/dist/src/runtime/emitters.js +29 -0
- package/dist/src/runtime/emitters.js.map +1 -1
- package/dist/src/runtime/scalar-fusion.d.ts +47 -0
- package/dist/src/runtime/scalar-fusion.d.ts.map +1 -0
- package/dist/src/runtime/scalar-fusion.js +275 -0
- package/dist/src/runtime/scalar-fusion.js.map +1 -0
- package/dist/src/runtime/strict-flags.d.ts +9 -0
- package/dist/src/runtime/strict-flags.d.ts.map +1 -1
- package/dist/src/runtime/strict-flags.js +9 -0
- package/dist/src/runtime/strict-flags.js.map +1 -1
- package/dist/src/runtime/strict-fork.js +2 -2
- package/dist/src/runtime/strict-fork.js.map +1 -1
- package/dist/src/runtime/strict-representation.d.ts +78 -0
- package/dist/src/runtime/strict-representation.d.ts.map +1 -0
- package/dist/src/runtime/strict-representation.js +159 -0
- package/dist/src/runtime/strict-representation.js.map +1 -0
- package/dist/src/schema/assertion.d.ts +58 -0
- package/dist/src/schema/assertion.d.ts.map +1 -1
- package/dist/src/schema/assertion.js +78 -0
- package/dist/src/schema/assertion.js.map +1 -1
- package/dist/src/schema/catalog-persistability.d.ts +11 -3
- package/dist/src/schema/catalog-persistability.d.ts.map +1 -1
- package/dist/src/schema/catalog-persistability.js +48 -29
- package/dist/src/schema/catalog-persistability.js.map +1 -1
- package/dist/src/schema/catalog.d.ts +22 -0
- package/dist/src/schema/catalog.d.ts.map +1 -1
- package/dist/src/schema/catalog.js +4 -1
- package/dist/src/schema/catalog.js.map +1 -1
- package/dist/src/schema/column-republication.d.ts +126 -0
- package/dist/src/schema/column-republication.d.ts.map +1 -0
- package/dist/src/schema/column-republication.js +121 -0
- package/dist/src/schema/column-republication.js.map +1 -0
- package/dist/src/schema/column-source-resolver.d.ts +29 -6
- package/dist/src/schema/column-source-resolver.d.ts.map +1 -1
- package/dist/src/schema/column-source-resolver.js +78 -9
- package/dist/src/schema/column-source-resolver.js.map +1 -1
- package/dist/src/schema/expression-dependents.d.ts +160 -0
- package/dist/src/schema/expression-dependents.d.ts.map +1 -0
- package/dist/src/schema/expression-dependents.js +228 -0
- package/dist/src/schema/expression-dependents.js.map +1 -0
- package/dist/src/schema/function.d.ts +15 -0
- package/dist/src/schema/function.d.ts.map +1 -1
- package/dist/src/schema/function.js.map +1 -1
- package/dist/src/schema/object-dependency-closure.d.ts +127 -0
- package/dist/src/schema/object-dependency-closure.d.ts.map +1 -0
- package/dist/src/schema/object-dependency-closure.js +117 -0
- package/dist/src/schema/object-dependency-closure.js.map +1 -0
- package/dist/src/schema/object-ref-resolver.d.ts +83 -0
- package/dist/src/schema/object-ref-resolver.d.ts.map +1 -0
- package/dist/src/schema/object-ref-resolver.js +135 -0
- package/dist/src/schema/object-ref-resolver.js.map +1 -0
- package/dist/src/schema/rename/column-rename.d.ts +228 -0
- package/dist/src/schema/rename/column-rename.d.ts.map +1 -0
- package/dist/src/schema/rename/column-rename.js +1225 -0
- package/dist/src/schema/rename/column-rename.js.map +1 -0
- package/dist/src/schema/rename/self-qualifier-strip.d.ts +29 -0
- package/dist/src/schema/rename/self-qualifier-strip.d.ts.map +1 -0
- package/dist/src/schema/rename/self-qualifier-strip.js +267 -0
- package/dist/src/schema/rename/self-qualifier-strip.js.map +1 -0
- package/dist/src/schema/rename/shared.d.ts +108 -0
- package/dist/src/schema/rename/shared.d.ts.map +1 -0
- package/dist/src/schema/rename/shared.js +49 -0
- package/dist/src/schema/rename/shared.js.map +1 -0
- package/dist/src/schema/rename/table-rename.d.ts +263 -0
- package/dist/src/schema/rename/table-rename.d.ts.map +1 -0
- package/dist/src/schema/rename/table-rename.js +860 -0
- package/dist/src/schema/rename/table-rename.js.map +1 -0
- package/dist/src/schema/rename-rewriter.d.ts +18 -278
- package/dist/src/schema/rename-rewriter.d.ts.map +1 -1
- package/dist/src/schema/rename-rewriter.js +17 -1506
- package/dist/src/schema/rename-rewriter.js.map +1 -1
- package/dist/src/schema/schema-differ.d.ts.map +1 -1
- package/dist/src/schema/schema-differ.js +228 -21
- package/dist/src/schema/schema-differ.js.map +1 -1
- package/dist/src/types/builtin-types.d.ts.map +1 -1
- package/dist/src/types/builtin-types.js +29 -36
- package/dist/src/types/builtin-types.js.map +1 -1
- package/dist/src/types/cast-semantics.d.ts +7 -5
- package/dist/src/types/cast-semantics.d.ts.map +1 -1
- package/dist/src/types/cast-semantics.js +20 -9
- package/dist/src/types/cast-semantics.js.map +1 -1
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/registry.d.ts.map +1 -1
- package/dist/src/types/registry.js +2 -1
- package/dist/src/types/registry.js.map +1 -1
- package/dist/src/types/temporal-ops.d.ts +119 -0
- package/dist/src/types/temporal-ops.d.ts.map +1 -0
- package/dist/src/types/temporal-ops.js +348 -0
- package/dist/src/types/temporal-ops.js.map +1 -0
- package/dist/src/types/temporal-types.d.ts +11 -0
- package/dist/src/types/temporal-types.d.ts.map +1 -1
- package/dist/src/types/temporal-types.js +87 -0
- package/dist/src/types/temporal-types.js.map +1 -1
- package/dist/src/util/affinity.d.ts +2 -1
- package/dist/src/util/affinity.d.ts.map +1 -1
- package/dist/src/util/affinity.js +16 -5
- package/dist/src/util/affinity.js.map +1 -1
- package/dist/src/util/ast-spine-clone.d.ts +2 -2
- package/dist/src/util/ast-spine-clone.js +2 -2
- package/dist/src/util/coercion.d.ts +22 -7
- package/dist/src/util/coercion.d.ts.map +1 -1
- package/dist/src/util/coercion.js +28 -15
- package/dist/src/util/coercion.js.map +1 -1
- package/dist/src/util/comparison.d.ts +25 -0
- package/dist/src/util/comparison.d.ts.map +1 -1
- package/dist/src/util/comparison.js +25 -0
- package/dist/src/util/comparison.js.map +1 -1
- package/dist/src/util/key-tuple-codec.d.ts +12 -3
- package/dist/src/util/key-tuple-codec.d.ts.map +1 -1
- package/dist/src/util/key-tuple-codec.js.map +1 -1
- package/dist/src/util/numeric-canonical.d.ts +26 -0
- package/dist/src/util/numeric-canonical.d.ts.map +1 -0
- package/dist/src/util/numeric-canonical.js +66 -0
- package/dist/src/util/numeric-canonical.js.map +1 -0
- package/dist/src/util/value-text.d.ts +48 -0
- package/dist/src/util/value-text.d.ts.map +1 -0
- package/dist/src/util/value-text.js +35 -0
- package/dist/src/util/value-text.js.map +1 -0
- package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.js +14 -5
- package/dist/src/vtab/memory/layer/manager.js.map +1 -1
- package/dist/src/vtab/module.d.ts +25 -0
- package/dist/src/vtab/module.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { asRun } from '../types.js';
|
|
2
2
|
import { emitPlanNode, emitCallFromPlan } from '../emitters.js';
|
|
3
|
-
import { isAggregateFunctionSchema } from '../../schema/function.js';
|
|
4
|
-
import { AggregateFunctionCallNode } from '../../planner/nodes/aggregate-function.js';
|
|
5
3
|
import { isRelationalNode } from '../../planner/nodes/plan-node.js';
|
|
6
4
|
import { createValueSet } from '../../util/value-set.js';
|
|
7
5
|
import { logContextPush, logContextPop } from '../utils.js';
|
|
8
|
-
import { coerceForAggregate } from '../../util/coercion.js';
|
|
9
|
-
import { quereusError } from '../../common/errors.js';
|
|
10
|
-
import { StatusCode } from '../../common/types.js';
|
|
11
6
|
import { buildRowDescriptor } from '../../util/row-descriptor.js';
|
|
12
7
|
import { serializeKeyNullGrouping } from '../../util/key-serializer.js';
|
|
13
8
|
import { semanticKeyTransform } from '../../util/comparison.js';
|
|
14
9
|
import { hashKeyCollationName } from '../../planner/analysis/comparison-collation.js';
|
|
15
10
|
import { cloneInitialValue, findSourceRelation, ctxLog } from './aggregate.js';
|
|
16
|
-
import { bindAggregateSchemas, buildDistinctComparators,
|
|
11
|
+
import { bindAggregateSchemas, buildDistinctComparators, computeAggregateValueTransforms, emitAggregateArgInstructions, evalArgsSync } from './aggregate-setup.js';
|
|
17
12
|
export function emitHashAggregate(plan, ctx) {
|
|
18
13
|
const sourceRelation = findSourceRelation(plan.source);
|
|
19
14
|
const sourceAttributes = plan.source.getAttributes();
|
|
@@ -46,25 +41,19 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
46
41
|
const keyCanonicalizers = plan.groupBy.map(expr => semanticKeyTransform(expr.getType().logicalType));
|
|
47
42
|
const hasKeyCanonicalizer = keyCanonicalizers.some(c => c !== undefined);
|
|
48
43
|
const distinctComparators = buildDistinctComparators(plan.aggregates, ctx);
|
|
49
|
-
const
|
|
50
|
-
const { schemas: aggregateSchemas, distinctFlags: aggregateDistinctFlags } = bindAggregateSchemas(plan.aggregates, ctx);
|
|
44
|
+
const aggregateValueTransforms = computeAggregateValueTransforms(plan.aggregates);
|
|
45
|
+
const { schemas: aggregateSchemas, distinctFlags: aggregateDistinctFlags, argCounts: aggregateArgCounts } = bindAggregateSchemas(plan.aggregates, ctx);
|
|
51
46
|
async function* run(ctx, sourceRows, ...groupByAndAggregateArgs) {
|
|
52
47
|
const numGroupBy = plan.groupBy.length;
|
|
53
48
|
const groupByFunctions = groupByAndAggregateArgs.slice(0, numGroupBy);
|
|
54
49
|
let aggregateArgOffset = numGroupBy;
|
|
55
50
|
const aggregateArgFunctions = [];
|
|
56
|
-
for (const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
quereusError(`Expected AggregateFunctionCallNode but got ${funcNode.constructor.name}`, StatusCode.INTERNAL);
|
|
60
|
-
}
|
|
61
|
-
const args = funcNode.args || [];
|
|
62
|
-
const aggregateArgs = groupByAndAggregateArgs.slice(aggregateArgOffset, aggregateArgOffset + args.length);
|
|
63
|
-
aggregateArgFunctions.push(aggregateArgs);
|
|
64
|
-
aggregateArgOffset += args.length;
|
|
51
|
+
for (const argCount of aggregateArgCounts) {
|
|
52
|
+
aggregateArgFunctions.push(groupByAndAggregateArgs.slice(aggregateArgOffset, aggregateArgOffset + argCount));
|
|
53
|
+
aggregateArgOffset += argCount;
|
|
65
54
|
}
|
|
66
55
|
function createAccumulators() {
|
|
67
|
-
return aggregateSchemas.map(schema => cloneInitialValue(
|
|
56
|
+
return aggregateSchemas.map(schema => cloneInitialValue(schema.initialValue));
|
|
68
57
|
}
|
|
69
58
|
function createDistinctTrees() {
|
|
70
59
|
return aggregateDistinctFlags.map((isDistinct, i) => isDistinct ? createValueSet(distinctComparators[i]) : null);
|
|
@@ -80,30 +69,16 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
80
69
|
logContextPush(scanRowDescriptor, 'scan-row', sourceAttributes);
|
|
81
70
|
try {
|
|
82
71
|
for (let i = 0; i < plan.aggregates.length; i++) {
|
|
83
|
-
const schema = aggregateSchemas[i];
|
|
84
72
|
const isDistinct = aggregateDistinctFlags[i];
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
quereusError(`Expected AggregateFunctionCallNode but got ${funcNode.constructor.name}`, StatusCode.INTERNAL);
|
|
88
|
-
}
|
|
89
|
-
const args = funcNode.args || [];
|
|
90
|
-
const argFunctions = aggregateArgFunctions[i];
|
|
91
|
-
const skipCoercion = aggregateSkipCoercion[i];
|
|
92
|
-
const argValues = [];
|
|
93
|
-
for (let j = 0; j < args.length; j++) {
|
|
94
|
-
const rawValue = await argFunctions[j](ctx);
|
|
95
|
-
const coercedValue = skipCoercion ? rawValue : coerceForAggregate(rawValue, funcNode.functionName || 'unknown');
|
|
96
|
-
argValues.push(coercedValue);
|
|
97
|
-
}
|
|
73
|
+
const argValuesMaybe = evalArgsSync(ctx, aggregateArgFunctions[i], aggregateValueTransforms[i]);
|
|
74
|
+
const argValues = argValuesMaybe instanceof Promise ? await argValuesMaybe : argValuesMaybe;
|
|
98
75
|
if (isDistinct) {
|
|
99
76
|
const distinctValue = argValues.length === 1 ? argValues[0] : argValues;
|
|
100
77
|
const existingPath = distinctTrees[i].insert(distinctValue);
|
|
101
78
|
if (!existingPath.on)
|
|
102
79
|
continue;
|
|
103
80
|
}
|
|
104
|
-
|
|
105
|
-
accumulators[i] = schema.stepFunction(accumulators[i], ...argValues);
|
|
106
|
-
}
|
|
81
|
+
accumulators[i] = aggregateSchemas[i].stepFunction(accumulators[i], ...argValues);
|
|
107
82
|
}
|
|
108
83
|
}
|
|
109
84
|
finally {
|
|
@@ -113,15 +88,7 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
113
88
|
}
|
|
114
89
|
const aggregateRow = [];
|
|
115
90
|
for (let i = 0; i < plan.aggregates.length; i++) {
|
|
116
|
-
|
|
117
|
-
let finalValue;
|
|
118
|
-
if (isAggregateFunctionSchema(schema)) {
|
|
119
|
-
finalValue = schema.finalizeFunction(accumulators[i]);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
finalValue = accumulators[i];
|
|
123
|
-
}
|
|
124
|
-
aggregateRow.push(finalValue);
|
|
91
|
+
aggregateRow.push(aggregateSchemas[i].finalizeFunction(accumulators[i]));
|
|
125
92
|
}
|
|
126
93
|
const fullRow = lastSourceRow ? [...aggregateRow, ...lastSourceRow] : aggregateRow;
|
|
127
94
|
if (lastSourceRow) {
|
|
@@ -151,10 +118,8 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
151
118
|
logContextPush(scanRowDescriptor, 'scan-row', sourceAttributes);
|
|
152
119
|
try {
|
|
153
120
|
// Evaluate GROUP BY expressions
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
groupValues.push(await groupByFunc(ctx));
|
|
157
|
-
}
|
|
121
|
+
const groupValuesMaybe = evalArgsSync(ctx, groupByFunctions);
|
|
122
|
+
const groupValues = groupValuesMaybe instanceof Promise ? await groupValuesMaybe : groupValuesMaybe;
|
|
158
123
|
// Serialize key using collation-aware serialization (NULLs group together per SQL standard)
|
|
159
124
|
const keyValues = hasKeyCanonicalizer
|
|
160
125
|
? groupValues.map((v, i) => keyCanonicalizers[i] ? keyCanonicalizers[i](v) : v)
|
|
@@ -173,30 +138,16 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
173
138
|
}
|
|
174
139
|
// Evaluate aggregate arguments and step accumulators
|
|
175
140
|
for (let i = 0; i < plan.aggregates.length; i++) {
|
|
176
|
-
const schema = aggregateSchemas[i];
|
|
177
141
|
const isDistinct = aggregateDistinctFlags[i];
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
quereusError(`Expected AggregateFunctionCallNode but got ${funcNode.constructor.name}`, StatusCode.INTERNAL);
|
|
181
|
-
}
|
|
182
|
-
const args = funcNode.args || [];
|
|
183
|
-
const argFunctions = aggregateArgFunctions[i];
|
|
184
|
-
const skipCoercion = aggregateSkipCoercion[i];
|
|
185
|
-
const argValues = [];
|
|
186
|
-
for (let j = 0; j < args.length; j++) {
|
|
187
|
-
const rawValue = await argFunctions[j](ctx);
|
|
188
|
-
const coercedValue = skipCoercion ? rawValue : coerceForAggregate(rawValue, funcNode.functionName || 'unknown');
|
|
189
|
-
argValues.push(coercedValue);
|
|
190
|
-
}
|
|
142
|
+
const argValuesMaybe = evalArgsSync(ctx, aggregateArgFunctions[i], aggregateValueTransforms[i]);
|
|
143
|
+
const argValues = argValuesMaybe instanceof Promise ? await argValuesMaybe : argValuesMaybe;
|
|
191
144
|
if (isDistinct) {
|
|
192
145
|
const distinctValue = argValues.length === 1 ? argValues[0] : argValues;
|
|
193
146
|
const existingPath = group.distinctTrees[i].insert(distinctValue);
|
|
194
147
|
if (!existingPath.on)
|
|
195
148
|
continue;
|
|
196
149
|
}
|
|
197
|
-
|
|
198
|
-
group.accumulators[i] = schema.stepFunction(group.accumulators[i], ...argValues);
|
|
199
|
-
}
|
|
150
|
+
group.accumulators[i] = aggregateSchemas[i].stepFunction(group.accumulators[i], ...argValues);
|
|
200
151
|
}
|
|
201
152
|
}
|
|
202
153
|
finally {
|
|
@@ -211,15 +162,7 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
211
162
|
aggregateRow.push(...group.groupValues);
|
|
212
163
|
// Finalized aggregate values
|
|
213
164
|
for (let i = 0; i < plan.aggregates.length; i++) {
|
|
214
|
-
|
|
215
|
-
let finalValue;
|
|
216
|
-
if (isAggregateFunctionSchema(schema)) {
|
|
217
|
-
finalValue = schema.finalizeFunction(group.accumulators[i]);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
finalValue = group.accumulators[i];
|
|
221
|
-
}
|
|
222
|
-
aggregateRow.push(finalValue);
|
|
165
|
+
aggregateRow.push(aggregateSchemas[i].finalizeFunction(group.accumulators[i]));
|
|
223
166
|
}
|
|
224
167
|
// Set up combined context (output + representative source row) for HAVING
|
|
225
168
|
const fullRow = [...aggregateRow, ...group.representativeSourceRow];
|
|
@@ -252,20 +195,7 @@ export function emitHashAggregate(plan, ctx) {
|
|
|
252
195
|
}
|
|
253
196
|
const sourceInstruction = emitPlanNode(plan.source, ctx);
|
|
254
197
|
const groupByInstructions = plan.groupBy.map(expr => emitCallFromPlan(expr, ctx));
|
|
255
|
-
const aggregateArgInstructions =
|
|
256
|
-
for (const agg of plan.aggregates) {
|
|
257
|
-
const funcNode = agg.expression;
|
|
258
|
-
if (!(funcNode instanceof AggregateFunctionCallNode)) {
|
|
259
|
-
quereusError(`Expected AggregateFunctionCallNode but got ${funcNode.constructor.name}`, StatusCode.INTERNAL);
|
|
260
|
-
}
|
|
261
|
-
const args = funcNode.args || [];
|
|
262
|
-
for (const arg of args) {
|
|
263
|
-
if (!arg) {
|
|
264
|
-
quereusError(`Aggregate argument is undefined for function ${funcNode.functionName}`, StatusCode.INTERNAL);
|
|
265
|
-
}
|
|
266
|
-
aggregateArgInstructions.push(emitCallFromPlan(arg, ctx));
|
|
267
|
-
}
|
|
268
|
-
}
|
|
198
|
+
const aggregateArgInstructions = emitAggregateArgInstructions(plan.aggregates, ctx);
|
|
269
199
|
return {
|
|
270
200
|
params: [sourceInstruction, ...groupByInstructions, ...aggregateArgInstructions],
|
|
271
201
|
run: asRun(run),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-aggregate.js","sourceRoot":"","sources":["../../../../src/runtime/emit/hash-aggregate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAA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GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAElF,MAAM,wBAAwB,GAAG,4BAA4B,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAEpF,OAAO;QACN,MAAM,EAAE,CAAC,iBAAiB,EAAE,GAAG,mBAAmB,EAAE,GAAG,wBAAwB,CAAC;QAChF,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;QACf,IAAI,EAAE,kBAAkB,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,QAAQ;KACtI,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { Instruction } from "../types.js";
|
|
2
2
|
import type { LiteralNode } from "../../planner/nodes/scalar.js";
|
|
3
3
|
import type { EmissionContext } from "../emission-context.js";
|
|
4
|
-
|
|
4
|
+
import { type ScalarOpSpec } from "./scalar-op.js";
|
|
5
|
+
/**
|
|
6
|
+
* Zero-operand spec yielding the literal's value, or `undefined` when the value is an
|
|
7
|
+
* unresolved Promise.
|
|
8
|
+
*
|
|
9
|
+
* The constant-folding pass (planner/analysis/const-pass.ts) parks the result of an
|
|
10
|
+
* *async* fold straight into `LiteralExpr.value` without awaiting it and lets the
|
|
11
|
+
* scheduler resolve it, so a literal's body is `MaybePromise<SqlValue>` in general —
|
|
12
|
+
* which is not a {@link ScalarOpSpec} body. Rather than widen the spec contract for
|
|
13
|
+
* every scalar op, that rare arm has no spec and its consumers fall back: the emitter
|
|
14
|
+
* below builds the Instruction itself, and a fusion consumer must decline to fuse.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildLiteralSpec(plan: LiteralNode): ScalarOpSpec | undefined;
|
|
17
|
+
export declare function emitLiteral(plan: LiteralNode, ctx: EmissionContext): Instruction;
|
|
5
18
|
//# sourceMappingURL=literal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/literal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/literal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,CAS5E;AAOD,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,WAAW,CAUhF"}
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
import { asRun } from "../types.js";
|
|
2
1
|
import { safeJsonStringify } from "../../util/serialization.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { emitScalarOp } from "./scalar-op.js";
|
|
3
|
+
/**
|
|
4
|
+
* Zero-operand spec yielding the literal's value, or `undefined` when the value is an
|
|
5
|
+
* unresolved Promise.
|
|
6
|
+
*
|
|
7
|
+
* The constant-folding pass (planner/analysis/const-pass.ts) parks the result of an
|
|
8
|
+
* *async* fold straight into `LiteralExpr.value` without awaiting it and lets the
|
|
9
|
+
* scheduler resolve it, so a literal's body is `MaybePromise<SqlValue>` in general —
|
|
10
|
+
* which is not a {@link ScalarOpSpec} body. Rather than widen the spec contract for
|
|
11
|
+
* every scalar op, that rare arm has no spec and its consumers fall back: the emitter
|
|
12
|
+
* below builds the Instruction itself, and a fusion consumer must decline to fuse.
|
|
13
|
+
*/
|
|
14
|
+
export function buildLiteralSpec(plan) {
|
|
15
|
+
const value = plan.expression.value;
|
|
16
|
+
if (value instanceof Promise)
|
|
17
|
+
return undefined;
|
|
18
|
+
return {
|
|
19
|
+
operands: [],
|
|
20
|
+
run: (_rctx) => value,
|
|
21
|
+
note: literalNote(value)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Note text shared by both arms — `safeJsonStringify` of a Promise spells `{}`, as before. */
|
|
25
|
+
function literalNote(value) {
|
|
26
|
+
return `literal(${safeJsonStringify(value)})`;
|
|
27
|
+
}
|
|
28
|
+
export function emitLiteral(plan, ctx) {
|
|
29
|
+
const spec = buildLiteralSpec(plan);
|
|
30
|
+
if (spec)
|
|
31
|
+
return emitScalarOp(spec, ctx);
|
|
32
|
+
const deferred = plan.expression.value;
|
|
7
33
|
return {
|
|
8
34
|
params: [],
|
|
9
|
-
run:
|
|
10
|
-
note:
|
|
35
|
+
run: (_rctx) => deferred,
|
|
36
|
+
note: literalNote(deferred)
|
|
11
37
|
};
|
|
12
38
|
}
|
|
13
39
|
//# sourceMappingURL=literal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../src/runtime/emit/literal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../src/runtime/emit/literal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAiB;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;IACpC,IAAI,KAAK,YAAY,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/C,OAAO;QACN,QAAQ,EAAE,EAAE;QACZ,GAAG,EAAE,CAAC,KAAqB,EAAE,EAAE,CAAC,KAAK;QACrC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;KACxB,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,SAAS,WAAW,CAAC,KAAmC;IACvD,OAAO,WAAW,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAiB,EAAE,GAAoB;IAClE,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,IAAI;QAAE,OAAO,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;IACvC,OAAO;QACN,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,CAAC,KAAqB,EAAE,EAAE,CAAC,QAAQ;QACxC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC;KAC3B,CAAC;AACH,CAAC"}
|
|
@@ -9,6 +9,7 @@ import type { CoarsenedKeyInfo } from '../../schema/view.js';
|
|
|
9
9
|
import { computeBodyHash } from '../../schema/view.js';
|
|
10
10
|
import { type MaintainedTableSchema } from '../../schema/derivation.js';
|
|
11
11
|
import type { Schema } from '../../schema/schema.js';
|
|
12
|
+
import type { ResolveObjectRef, TableRenameTarget } from '../../schema/rename-rewriter.js';
|
|
12
13
|
import type { ResolveColumnInSource } from '../../schema/rename-rewriter.js';
|
|
13
14
|
import type { BackingHost } from '../../vtab/backing-host.js';
|
|
14
15
|
export { computeBodyHash };
|
|
@@ -375,8 +376,14 @@ export declare function createMaintainedTable(db: Database, stmt: AST.CreateTabl
|
|
|
375
376
|
* behavior. The caller is responsible for staleness re-validation when relevant;
|
|
376
377
|
* this helper assumes the derivation body plans. Throws if the table is missing
|
|
377
378
|
* from the catalog.
|
|
379
|
+
*
|
|
380
|
+
* `validationColumns` is the reshape arm's column preview
|
|
381
|
+
* ({@link previewReshapedColumns}) — the type/collation attributes the reshape's
|
|
382
|
+
* still-pending post-reconcile ops are about to land — forwarded to the scan so
|
|
383
|
+
* the CHECK / FK resolve against the final declared shape. `undefined` on every
|
|
384
|
+
* other path (and on a reshape that shifts neither attribute).
|
|
378
385
|
*/
|
|
379
|
-
export declare function rebuildBacking(db: Database, mv: MaintainedTableSchema): Promise<void>;
|
|
386
|
+
export declare function rebuildBacking(db: Database, mv: MaintainedTableSchema, validationColumns?: readonly ColumnSchema[]): Promise<void>;
|
|
380
387
|
/**
|
|
381
388
|
* True iff the live backing `TableSchema` is structurally identical to what the
|
|
382
389
|
* derived `shape` would build — so a `refresh` can take the data-only fast path
|
|
@@ -591,8 +598,9 @@ export declare function snapshotStaleMaterializedViews(db: Database): ReadonlySe
|
|
|
591
598
|
/**
|
|
592
599
|
* Rewrites every dependent materialized view in `schema` after a source TABLE
|
|
593
600
|
* RENAME — the MV mirror of the plain-view loop in `propagateTableRenameInSchema`
|
|
594
|
-
* ("MV ≡ faster view"): the caller
|
|
595
|
-
* `
|
|
601
|
+
* ("MV ≡ faster view"): the caller calls this once per schema in the catalog with
|
|
602
|
+
* `target` bound to THAT schema's home path, and the body `selectAst` is mutated
|
|
603
|
+
* in place by the same `renameTableInAst` walker. An MV is
|
|
596
604
|
* processed when its body AST changed, its `insert defaults` clause changed (an
|
|
597
605
|
* expr subquery can name the renamed table even when the body doesn't), OR its
|
|
598
606
|
* `sourceTables` carries the old base — the latter catches a body that reads the
|
|
@@ -607,11 +615,14 @@ export declare function snapshotStaleMaterializedViews(db: Database): ReadonlySe
|
|
|
607
615
|
* `materialized_view_modified`. Failures mark the MV stale and propagation
|
|
608
616
|
* continues — best-effort, like the rest of the rename propagation.
|
|
609
617
|
*/
|
|
610
|
-
export declare function propagateTableRenameToMaterializedViews(db: Database, schema: Schema,
|
|
618
|
+
export declare function propagateTableRenameToMaterializedViews(db: Database, schema: Schema, preStale: ReadonlySet<string>, target: TableRenameTarget): Promise<void>;
|
|
611
619
|
/**
|
|
612
620
|
* Rewrites every dependent materialized view in `schema` after a source COLUMN
|
|
613
621
|
* RENAME — the MV mirror of the plain-view loop in `propagateColumnRenameInSchema`
|
|
614
|
-
* (
|
|
622
|
+
* (called once per schema PER CASCADE ROUND — the target may be the renamed table
|
|
623
|
+
* or a view/MV whose published names a prior round shifted, see
|
|
624
|
+
* `column-rename-cascade.ts` — with that schema's resolver, same in-place
|
|
625
|
+
* `renameColumnInAst` walk).
|
|
615
626
|
* The body walk also descends the trailing `with defaults (…)` clause (now on
|
|
616
627
|
* `selectAst.defaults`): the clause target is typically a projected-away NOT NULL
|
|
617
628
|
* column the body never mentions, so its rewrite still flips `bodyChanged` and
|
|
@@ -623,7 +634,7 @@ export declare function propagateTableRenameToMaterializedViews(db: Database, sc
|
|
|
623
634
|
* (a bare passthrough projection of the renamed column — plain-view parity),
|
|
624
635
|
* which {@link applyMaterializedViewRewrite} carries onto the live backing table.
|
|
625
636
|
*/
|
|
626
|
-
export declare function propagateColumnRenameToMaterializedViews(db: Database, schema: Schema,
|
|
637
|
+
export declare function propagateColumnRenameToMaterializedViews(db: Database, schema: Schema, tableName: string, oldCol: string, newCol: string, preStale: ReadonlySet<string>, resolve: ResolveObjectRef, targetKey: string, resolveColumnInSource: ResolveColumnInSource): Promise<void>;
|
|
627
638
|
/**
|
|
628
639
|
* Restores every dependent MV that THIS rename statement marked stale but the
|
|
629
640
|
* rename provably did not affect. Runs once at the end of the table-/column-rename
|
|
@@ -655,10 +666,22 @@ export declare function propagateColumnRenameToMaterializedViews(db: Database, s
|
|
|
655
666
|
* sql, sourceTables) is unchanged here — `stale` is runtime state, not persisted.
|
|
656
667
|
* Walks all schemas (the listener marks cross-schema dependents too), in creation
|
|
657
668
|
* order — topological for same-schema MV chains, so a producer restores before its
|
|
658
|
-
* consumer is examined. A chained MV
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
669
|
+
* consumer is examined. A chained MV normally follows a producer's shifted output
|
|
670
|
+
* name through the cascade driver's later rounds (`column-rename-cascade.ts`); one
|
|
671
|
+
* whose body still references a renamed-away name (a mid-statement rewrite
|
|
672
|
+
* failure) fails shape derivation here and stays stale.
|
|
673
|
+
*
|
|
674
|
+
* NOTE: the walk is schema-by-schema, then creation order WITHIN a schema, so a
|
|
675
|
+
* CROSS-schema MV chain is only topological when the producer's schema is iterated
|
|
676
|
+
* first. Harmless today — a consumer whose body does not itself name the renamed
|
|
677
|
+
* object is skipped by the propagation entirely and only ever reaches this pass, and
|
|
678
|
+
* a producer whose own NAME did not change re-plans fine either way (verified for
|
|
679
|
+
* both verbs in `test/schema/rename-cross-schema.spec.ts`). If a producer's output
|
|
680
|
+
* names can shift while its consumer lives in an earlier-iterated schema, this pass
|
|
681
|
+
* needs a topological order (or a second round) rather than catalog order.
|
|
682
|
+
*
|
|
683
|
+
* Best-effort like the rest of the propagation: a per-MV failure logs, leaves that MV
|
|
684
|
+
* stale, and continues.
|
|
662
685
|
*
|
|
663
686
|
* NOTE: firing no `materialized_view_modified` is deliberate, but
|
|
664
687
|
* {@link renameShiftedBackingColumns} (run from the shared restore tail) DOES change the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialized-view-helpers.d.ts","sourceRoot":"","sources":["../../../../src/runtime/emit/materialized-view-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAc,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EAAY,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAMrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,w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