1pub const MAX_AGGREGATE_DISTINCT_VALUES_V1: u16 = 256;
9pub const MAX_AGGREGATE_STATE_BYTES_V1: u32 = 1_048_576;
11pub const MAX_AGGREGATE_ARITHMETIC_OPERATIONS_V1: u32 = 8_192;
13
14#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17pub enum AggregateSemanticIdentityV1 {
18 Count,
20 ExactCount,
22 Sum,
24 Min,
26 Max,
28 CountPresent,
30 CountDistinct,
32 CountDistinctPresent,
34 Mean,
36 Any,
38 All,
40}
41
42impl AggregateSemanticIdentityV1 {
43 #[must_use]
45 pub fn from_source_spelling(spelling: &str) -> Option<Self> {
46 aggregate_semantic_registry_v1()
47 .iter()
48 .chain(SAAS_OPERATIONAL_AGGREGATE_REGISTRY_V1.iter())
49 .find(|descriptor| descriptor.source_spelling == spelling)
50 .map(|descriptor| descriptor.identity)
51 }
52
53 #[must_use]
55 pub const fn descriptor(self) -> &'static AggregateSemanticDescriptorV1 {
56 match self {
57 Self::Count => &AGGREGATE_SEMANTIC_REGISTRY_V1[0],
58 Self::ExactCount => &AGGREGATE_SEMANTIC_REGISTRY_V1[1],
59 Self::Sum => &AGGREGATE_SEMANTIC_REGISTRY_V1[2],
60 Self::Min => &AGGREGATE_SEMANTIC_REGISTRY_V1[3],
61 Self::Max => &AGGREGATE_SEMANTIC_REGISTRY_V1[4],
62 Self::CountPresent => &AGGREGATE_SEMANTIC_REGISTRY_V1[5],
63 Self::CountDistinct => &AGGREGATE_SEMANTIC_REGISTRY_V1[6],
64 Self::CountDistinctPresent => &AGGREGATE_SEMANTIC_REGISTRY_V1[7],
65 Self::Mean => &AGGREGATE_SEMANTIC_REGISTRY_V1[8],
66 Self::Any => &AGGREGATE_SEMANTIC_REGISTRY_V1[9],
67 Self::All => &AGGREGATE_SEMANTIC_REGISTRY_V1[10],
68 }
69 }
70}
71
72#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct AggregateSemanticSetV1(u16);
80
81impl AggregateSemanticSetV1 {
82 pub const NONE: Self = Self(0);
84 pub const BOUNDED_EXACT_CORE: Self = Self(
86 semantic_bit(AggregateSemanticIdentityV1::Count)
87 | semantic_bit(AggregateSemanticIdentityV1::Sum)
88 | semantic_bit(AggregateSemanticIdentityV1::Min)
89 | semantic_bit(AggregateSemanticIdentityV1::Max)
90 | semantic_bit(AggregateSemanticIdentityV1::CountPresent)
91 | semantic_bit(AggregateSemanticIdentityV1::CountDistinct)
92 | semantic_bit(AggregateSemanticIdentityV1::CountDistinctPresent)
93 | semantic_bit(AggregateSemanticIdentityV1::Mean)
94 | semantic_bit(AggregateSemanticIdentityV1::Any)
95 | semantic_bit(AggregateSemanticIdentityV1::All),
96 );
97 pub const EXACT_COUNT_ONLY: Self = Self(semantic_bit(AggregateSemanticIdentityV1::ExactCount));
100
101 #[must_use]
103 pub const fn contains(self, identity: AggregateSemanticIdentityV1) -> bool {
104 self.0 & semantic_bit(identity) != 0
105 }
106
107 #[must_use]
109 pub const fn len(self) -> u32 {
110 self.0.count_ones()
111 }
112
113 #[must_use]
115 pub const fn is_empty(self) -> bool {
116 self.0 == 0
117 }
118}
119
120const fn semantic_bit(identity: AggregateSemanticIdentityV1) -> u16 {
121 match identity {
122 AggregateSemanticIdentityV1::Count => 1 << 0,
123 AggregateSemanticIdentityV1::ExactCount => 1 << 1,
124 AggregateSemanticIdentityV1::Sum => 1 << 2,
125 AggregateSemanticIdentityV1::Min => 1 << 3,
126 AggregateSemanticIdentityV1::Max => 1 << 4,
127 AggregateSemanticIdentityV1::CountPresent => 1 << 5,
128 AggregateSemanticIdentityV1::CountDistinct => 1 << 6,
129 AggregateSemanticIdentityV1::CountDistinctPresent => 1 << 7,
130 AggregateSemanticIdentityV1::Mean => 1 << 8,
131 AggregateSemanticIdentityV1::Any => 1 << 9,
132 AggregateSemanticIdentityV1::All => 1 << 10,
133 }
134}
135
136#[derive(Clone, Copy, Debug, Eq, PartialEq)]
138pub enum AggregateInputClassV1 {
139 NoField,
141 ExactNumericField,
143 OrderedScalarField,
145 CanonicalScalarField,
147 RequiredBooleanField,
149}
150
151#[derive(Clone, Copy, Debug, Eq, PartialEq)]
153pub enum AggregateNoValueRuleV1 {
154 CountsRow,
156 InvalidInputType,
158 ComparableState,
160 Excluded,
162 DistinctValue,
164}
165
166#[derive(Clone, Copy, Debug, Eq, PartialEq)]
168pub enum AggregateEmptyResultV1 {
169 UnsignedZero,
171 ExactNumericZero,
173 Absent,
175 ExactMeanZero,
177 BooleanFalse,
179 BooleanTrue,
181}
182
183#[derive(Clone, Copy, Debug, Eq, PartialEq)]
185pub enum AggregateResultSchemaV1 {
186 U64,
188 ExactDecimalAtInputScale,
190 OptionalInputScalar,
192 ExactMeanV1,
194 Bool,
196 BoundedInputScalarList,
198}
199
200#[derive(Clone, Copy, Debug, Eq, PartialEq)]
202pub enum AggregatePartialStateV1 {
203 CheckedU64,
205 CheckedI128AtInputScale,
207 OptionalOrderedScalar,
209 BoundedCanonicalSet,
211 ExactMeanV1,
213 BooleanAny,
215 BooleanAll,
217}
218
219#[derive(Clone, Copy, Debug, Eq, PartialEq)]
221pub enum AggregateArithmeticV1 {
222 CheckedU64,
224 CheckedI128,
226 FrozenTypedComparator,
228 CanonicalDistinctSet,
230 CheckedExactMean,
232 BooleanOr,
234 BooleanAnd,
236}
237
238#[derive(Clone, Copy, Debug, Eq, PartialEq)]
240pub struct AggregateEligibilityV1 {
241 ordinary_bounded_fold: bool,
242 grouped_bounded_fold: bool,
243 whole_result_provider: bool,
244}
245
246impl AggregateEligibilityV1 {
247 #[must_use]
249 pub const fn ordinary_bounded_fold(self) -> bool {
250 self.ordinary_bounded_fold
251 }
252
253 #[must_use]
255 pub const fn grouped_bounded_fold(self) -> bool {
256 self.grouped_bounded_fold
257 }
258
259 #[must_use]
261 pub const fn whole_result_provider(self) -> bool {
262 self.whole_result_provider
263 }
264}
265
266#[derive(Clone, Copy, Debug, Eq, PartialEq)]
268pub enum AggregateBudgetBoundV1 {
269 NotApplicable,
271 CompilerPlan,
273 CompilerPlanWhenGrouped,
275}
276
277#[derive(Clone, Copy, Debug, Eq, PartialEq)]
279pub struct AggregateBudgetDimensionsV1 {
280 input_rows: AggregateBudgetBoundV1,
281 distinct_values: AggregateBudgetBoundV1,
282 groups: AggregateBudgetBoundV1,
283 state_bytes: AggregateBudgetBoundV1,
284 output_bytes: AggregateBudgetBoundV1,
285 diagnostic_work: AggregateBudgetBoundV1,
286}
287
288impl AggregateBudgetDimensionsV1 {
289 #[must_use]
291 pub const fn charges_input_rows(self) -> bool {
292 !matches!(self.input_rows, AggregateBudgetBoundV1::NotApplicable)
293 }
294
295 #[must_use]
297 pub const fn input_rows(self) -> AggregateBudgetBoundV1 {
298 self.input_rows
299 }
300
301 #[must_use]
303 pub const fn distinct_values(self) -> AggregateBudgetBoundV1 {
304 self.distinct_values
305 }
306
307 #[must_use]
309 pub const fn charges_groups(self) -> bool {
310 !matches!(self.groups, AggregateBudgetBoundV1::NotApplicable)
311 }
312
313 #[must_use]
315 pub const fn groups(self) -> AggregateBudgetBoundV1 {
316 self.groups
317 }
318
319 #[must_use]
321 pub const fn charges_state_bytes(self) -> bool {
322 !matches!(self.state_bytes, AggregateBudgetBoundV1::NotApplicable)
323 }
324
325 #[must_use]
327 pub const fn state_bytes(self) -> AggregateBudgetBoundV1 {
328 self.state_bytes
329 }
330
331 #[must_use]
333 pub const fn charges_output_bytes(self) -> bool {
334 !matches!(self.output_bytes, AggregateBudgetBoundV1::NotApplicable)
335 }
336
337 #[must_use]
339 pub const fn output_bytes(self) -> AggregateBudgetBoundV1 {
340 self.output_bytes
341 }
342
343 #[must_use]
345 pub const fn charges_diagnostic_work(self) -> bool {
346 !matches!(self.diagnostic_work, AggregateBudgetBoundV1::NotApplicable)
347 }
348
349 #[must_use]
351 pub const fn diagnostic_work(self) -> AggregateBudgetBoundV1 {
352 self.diagnostic_work
353 }
354}
355
356#[derive(Clone, Copy, Debug, Eq, PartialEq)]
358pub struct AggregatePolicyV1 {
359 admits_rows_before_aggregation: bool,
360 partition_scoped_primary: bool,
361 withholds_partial_results: bool,
362}
363
364impl AggregatePolicyV1 {
365 #[must_use]
367 pub const fn admits_rows_before_aggregation(self) -> bool {
368 self.admits_rows_before_aggregation
369 }
370
371 #[must_use]
373 pub const fn partition_scoped_primary(self) -> bool {
374 self.partition_scoped_primary
375 }
376
377 #[must_use]
379 pub const fn withholds_partial_results(self) -> bool {
380 self.withholds_partial_results
381 }
382}
383
384#[derive(Clone, Copy, Debug, Eq, PartialEq)]
386pub struct AggregateSemanticDescriptorV1 {
387 identity: AggregateSemanticIdentityV1,
388 source_spelling: &'static str,
389 input_class: AggregateInputClassV1,
390 no_value_rule: AggregateNoValueRuleV1,
391 empty_result: AggregateEmptyResultV1,
392 result_schema: AggregateResultSchemaV1,
393 partial_state: AggregatePartialStateV1,
394 arithmetic: AggregateArithmeticV1,
395 operational_ir_tag: Option<u8>,
396 eligibility: AggregateEligibilityV1,
397 budgets: AggregateBudgetDimensionsV1,
398 policy: AggregatePolicyV1,
399}
400
401impl AggregateSemanticDescriptorV1 {
402 #[must_use]
404 pub const fn identity(self) -> AggregateSemanticIdentityV1 {
405 self.identity
406 }
407
408 #[must_use]
410 pub const fn source_spelling(self) -> &'static str {
411 self.source_spelling
412 }
413
414 #[must_use]
416 pub const fn input_class(self) -> AggregateInputClassV1 {
417 self.input_class
418 }
419
420 #[must_use]
422 pub const fn no_value_rule(self) -> AggregateNoValueRuleV1 {
423 self.no_value_rule
424 }
425
426 #[must_use]
428 pub const fn empty_result(self) -> AggregateEmptyResultV1 {
429 self.empty_result
430 }
431
432 #[must_use]
434 pub const fn result_schema(self) -> AggregateResultSchemaV1 {
435 self.result_schema
436 }
437
438 #[must_use]
440 pub const fn partial_state(self) -> AggregatePartialStateV1 {
441 self.partial_state
442 }
443
444 #[must_use]
446 pub const fn arithmetic(self) -> AggregateArithmeticV1 {
447 self.arithmetic
448 }
449
450 #[must_use]
453 pub const fn operational_ir_tag(self) -> Option<u8> {
454 self.operational_ir_tag
455 }
456
457 #[must_use]
459 pub const fn eligibility(self) -> AggregateEligibilityV1 {
460 self.eligibility
461 }
462
463 #[must_use]
465 pub const fn budgets(self) -> AggregateBudgetDimensionsV1 {
466 self.budgets
467 }
468
469 #[must_use]
471 pub const fn policy(self) -> AggregatePolicyV1 {
472 self.policy
473 }
474}
475
476const BOUNDED_AND_PROVIDER: AggregateEligibilityV1 = AggregateEligibilityV1 {
477 ordinary_bounded_fold: true,
478 grouped_bounded_fold: true,
479 whole_result_provider: true,
480};
481
482const WHOLE_RESULT_ONLY: AggregateEligibilityV1 = AggregateEligibilityV1 {
483 ordinary_bounded_fold: false,
484 grouped_bounded_fold: false,
485 whole_result_provider: true,
486};
487
488const EXACT_BUDGETS: AggregateBudgetDimensionsV1 = AggregateBudgetDimensionsV1 {
489 input_rows: AggregateBudgetBoundV1::CompilerPlan,
490 distinct_values: AggregateBudgetBoundV1::NotApplicable,
491 groups: AggregateBudgetBoundV1::CompilerPlanWhenGrouped,
492 state_bytes: AggregateBudgetBoundV1::CompilerPlan,
493 output_bytes: AggregateBudgetBoundV1::CompilerPlan,
494 diagnostic_work: AggregateBudgetBoundV1::CompilerPlan,
495};
496
497const EXACT_COUNT_BUDGETS: AggregateBudgetDimensionsV1 = AggregateBudgetDimensionsV1 {
498 input_rows: AggregateBudgetBoundV1::CompilerPlan,
499 distinct_values: AggregateBudgetBoundV1::NotApplicable,
500 groups: AggregateBudgetBoundV1::NotApplicable,
501 state_bytes: AggregateBudgetBoundV1::CompilerPlan,
502 output_bytes: AggregateBudgetBoundV1::CompilerPlan,
503 diagnostic_work: AggregateBudgetBoundV1::CompilerPlan,
504};
505
506const EXACT_DISTINCT_BUDGETS: AggregateBudgetDimensionsV1 = AggregateBudgetDimensionsV1 {
507 input_rows: AggregateBudgetBoundV1::CompilerPlan,
508 distinct_values: AggregateBudgetBoundV1::CompilerPlan,
509 groups: AggregateBudgetBoundV1::CompilerPlanWhenGrouped,
510 state_bytes: AggregateBudgetBoundV1::CompilerPlan,
511 output_bytes: AggregateBudgetBoundV1::CompilerPlan,
512 diagnostic_work: AggregateBudgetBoundV1::CompilerPlan,
513};
514
515const EXACT_POLICY: AggregatePolicyV1 = AggregatePolicyV1 {
516 admits_rows_before_aggregation: true,
517 partition_scoped_primary: true,
518 withholds_partial_results: true,
519};
520
521const AGGREGATE_SEMANTIC_REGISTRY_V1: [AggregateSemanticDescriptorV1; 11] = [
522 AggregateSemanticDescriptorV1 {
523 identity: AggregateSemanticIdentityV1::Count,
524 source_spelling: "count",
525 input_class: AggregateInputClassV1::NoField,
526 no_value_rule: AggregateNoValueRuleV1::CountsRow,
527 empty_result: AggregateEmptyResultV1::UnsignedZero,
528 result_schema: AggregateResultSchemaV1::U64,
529 partial_state: AggregatePartialStateV1::CheckedU64,
530 arithmetic: AggregateArithmeticV1::CheckedU64,
531 operational_ir_tag: Some(1),
532 eligibility: BOUNDED_AND_PROVIDER,
533 budgets: EXACT_BUDGETS,
534 policy: EXACT_POLICY,
535 },
536 AggregateSemanticDescriptorV1 {
537 identity: AggregateSemanticIdentityV1::ExactCount,
538 source_spelling: "exact_count",
539 input_class: AggregateInputClassV1::NoField,
540 no_value_rule: AggregateNoValueRuleV1::CountsRow,
541 empty_result: AggregateEmptyResultV1::UnsignedZero,
542 result_schema: AggregateResultSchemaV1::U64,
543 partial_state: AggregatePartialStateV1::CheckedU64,
544 arithmetic: AggregateArithmeticV1::CheckedU64,
545 operational_ir_tag: None,
546 eligibility: WHOLE_RESULT_ONLY,
547 budgets: EXACT_COUNT_BUDGETS,
548 policy: EXACT_POLICY,
549 },
550 AggregateSemanticDescriptorV1 {
551 identity: AggregateSemanticIdentityV1::Sum,
552 source_spelling: "sum",
553 input_class: AggregateInputClassV1::ExactNumericField,
554 no_value_rule: AggregateNoValueRuleV1::InvalidInputType,
555 empty_result: AggregateEmptyResultV1::ExactNumericZero,
556 result_schema: AggregateResultSchemaV1::ExactDecimalAtInputScale,
557 partial_state: AggregatePartialStateV1::CheckedI128AtInputScale,
558 arithmetic: AggregateArithmeticV1::CheckedI128,
559 operational_ir_tag: Some(2),
560 eligibility: BOUNDED_AND_PROVIDER,
561 budgets: EXACT_BUDGETS,
562 policy: EXACT_POLICY,
563 },
564 AggregateSemanticDescriptorV1 {
565 identity: AggregateSemanticIdentityV1::Min,
566 source_spelling: "min",
567 input_class: AggregateInputClassV1::OrderedScalarField,
568 no_value_rule: AggregateNoValueRuleV1::ComparableState,
569 empty_result: AggregateEmptyResultV1::Absent,
570 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
571 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
572 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
573 operational_ir_tag: Some(3),
574 eligibility: BOUNDED_AND_PROVIDER,
575 budgets: EXACT_BUDGETS,
576 policy: EXACT_POLICY,
577 },
578 AggregateSemanticDescriptorV1 {
579 identity: AggregateSemanticIdentityV1::Max,
580 source_spelling: "max",
581 input_class: AggregateInputClassV1::OrderedScalarField,
582 no_value_rule: AggregateNoValueRuleV1::ComparableState,
583 empty_result: AggregateEmptyResultV1::Absent,
584 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
585 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
586 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
587 operational_ir_tag: Some(4),
588 eligibility: BOUNDED_AND_PROVIDER,
589 budgets: EXACT_BUDGETS,
590 policy: EXACT_POLICY,
591 },
592 AggregateSemanticDescriptorV1 {
593 identity: AggregateSemanticIdentityV1::CountPresent,
594 source_spelling: "count_present",
595 input_class: AggregateInputClassV1::CanonicalScalarField,
596 no_value_rule: AggregateNoValueRuleV1::Excluded,
597 empty_result: AggregateEmptyResultV1::UnsignedZero,
598 result_schema: AggregateResultSchemaV1::U64,
599 partial_state: AggregatePartialStateV1::CheckedU64,
600 arithmetic: AggregateArithmeticV1::CheckedU64,
601 operational_ir_tag: Some(5),
602 eligibility: BOUNDED_AND_PROVIDER,
603 budgets: EXACT_BUDGETS,
604 policy: EXACT_POLICY,
605 },
606 AggregateSemanticDescriptorV1 {
607 identity: AggregateSemanticIdentityV1::CountDistinct,
608 source_spelling: "count_distinct",
609 input_class: AggregateInputClassV1::CanonicalScalarField,
610 no_value_rule: AggregateNoValueRuleV1::DistinctValue,
611 empty_result: AggregateEmptyResultV1::UnsignedZero,
612 result_schema: AggregateResultSchemaV1::U64,
613 partial_state: AggregatePartialStateV1::BoundedCanonicalSet,
614 arithmetic: AggregateArithmeticV1::CanonicalDistinctSet,
615 operational_ir_tag: Some(6),
616 eligibility: BOUNDED_AND_PROVIDER,
617 budgets: EXACT_DISTINCT_BUDGETS,
618 policy: EXACT_POLICY,
619 },
620 AggregateSemanticDescriptorV1 {
621 identity: AggregateSemanticIdentityV1::CountDistinctPresent,
622 source_spelling: "count_distinct_present",
623 input_class: AggregateInputClassV1::CanonicalScalarField,
624 no_value_rule: AggregateNoValueRuleV1::Excluded,
625 empty_result: AggregateEmptyResultV1::UnsignedZero,
626 result_schema: AggregateResultSchemaV1::U64,
627 partial_state: AggregatePartialStateV1::BoundedCanonicalSet,
628 arithmetic: AggregateArithmeticV1::CanonicalDistinctSet,
629 operational_ir_tag: Some(7),
630 eligibility: BOUNDED_AND_PROVIDER,
631 budgets: EXACT_DISTINCT_BUDGETS,
632 policy: EXACT_POLICY,
633 },
634 AggregateSemanticDescriptorV1 {
635 identity: AggregateSemanticIdentityV1::Mean,
636 source_spelling: "mean",
637 input_class: AggregateInputClassV1::ExactNumericField,
638 no_value_rule: AggregateNoValueRuleV1::InvalidInputType,
639 empty_result: AggregateEmptyResultV1::ExactMeanZero,
640 result_schema: AggregateResultSchemaV1::ExactMeanV1,
641 partial_state: AggregatePartialStateV1::ExactMeanV1,
642 arithmetic: AggregateArithmeticV1::CheckedExactMean,
643 operational_ir_tag: Some(8),
644 eligibility: BOUNDED_AND_PROVIDER,
645 budgets: EXACT_BUDGETS,
646 policy: EXACT_POLICY,
647 },
648 AggregateSemanticDescriptorV1 {
649 identity: AggregateSemanticIdentityV1::Any,
650 source_spelling: "any",
651 input_class: AggregateInputClassV1::RequiredBooleanField,
652 no_value_rule: AggregateNoValueRuleV1::InvalidInputType,
653 empty_result: AggregateEmptyResultV1::BooleanFalse,
654 result_schema: AggregateResultSchemaV1::Bool,
655 partial_state: AggregatePartialStateV1::BooleanAny,
656 arithmetic: AggregateArithmeticV1::BooleanOr,
657 operational_ir_tag: Some(9),
658 eligibility: BOUNDED_AND_PROVIDER,
659 budgets: EXACT_BUDGETS,
660 policy: EXACT_POLICY,
661 },
662 AggregateSemanticDescriptorV1 {
663 identity: AggregateSemanticIdentityV1::All,
664 source_spelling: "all",
665 input_class: AggregateInputClassV1::RequiredBooleanField,
666 no_value_rule: AggregateNoValueRuleV1::InvalidInputType,
667 empty_result: AggregateEmptyResultV1::BooleanTrue,
668 result_schema: AggregateResultSchemaV1::Bool,
669 partial_state: AggregatePartialStateV1::BooleanAll,
670 arithmetic: AggregateArithmeticV1::BooleanAnd,
671 operational_ir_tag: Some(10),
672 eligibility: BOUNDED_AND_PROVIDER,
673 budgets: EXACT_BUDGETS,
674 policy: EXACT_POLICY,
675 },
676];
677
678const BOUNDED_FOLD_ONLY: AggregateEligibilityV1 = AggregateEligibilityV1 {
679 ordinary_bounded_fold: true,
680 grouped_bounded_fold: true,
681 whole_result_provider: false,
682};
683
684const SAAS_OPERATIONAL_AGGREGATE_REGISTRY_V1: [AggregateSemanticDescriptorV1; 9] = [
685 AggregateSemanticDescriptorV1 {
686 identity: AggregateSemanticIdentityV1::Min,
687 source_spelling: "median",
688 input_class: AggregateInputClassV1::OrderedScalarField,
689 no_value_rule: AggregateNoValueRuleV1::Excluded,
690 empty_result: AggregateEmptyResultV1::Absent,
691 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
692 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
693 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
694 operational_ir_tag: Some(11),
695 eligibility: BOUNDED_FOLD_ONLY,
696 budgets: EXACT_BUDGETS,
697 policy: EXACT_POLICY,
698 },
699 AggregateSemanticDescriptorV1 {
700 identity: AggregateSemanticIdentityV1::Min,
701 source_spelling: "p90",
702 input_class: AggregateInputClassV1::OrderedScalarField,
703 no_value_rule: AggregateNoValueRuleV1::Excluded,
704 empty_result: AggregateEmptyResultV1::Absent,
705 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
706 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
707 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
708 operational_ir_tag: Some(12),
709 eligibility: BOUNDED_FOLD_ONLY,
710 budgets: EXACT_BUDGETS,
711 policy: EXACT_POLICY,
712 },
713 AggregateSemanticDescriptorV1 {
714 identity: AggregateSemanticIdentityV1::Min,
715 source_spelling: "p95",
716 input_class: AggregateInputClassV1::OrderedScalarField,
717 no_value_rule: AggregateNoValueRuleV1::Excluded,
718 empty_result: AggregateEmptyResultV1::Absent,
719 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
720 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
721 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
722 operational_ir_tag: Some(13),
723 eligibility: BOUNDED_FOLD_ONLY,
724 budgets: EXACT_BUDGETS,
725 policy: EXACT_POLICY,
726 },
727 AggregateSemanticDescriptorV1 {
728 identity: AggregateSemanticIdentityV1::Min,
729 source_spelling: "p99",
730 input_class: AggregateInputClassV1::OrderedScalarField,
731 no_value_rule: AggregateNoValueRuleV1::Excluded,
732 empty_result: AggregateEmptyResultV1::Absent,
733 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
734 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
735 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
736 operational_ir_tag: Some(14),
737 eligibility: BOUNDED_FOLD_ONLY,
738 budgets: EXACT_BUDGETS,
739 policy: EXACT_POLICY,
740 },
741 AggregateSemanticDescriptorV1 {
742 identity: AggregateSemanticIdentityV1::Min,
743 source_spelling: "first",
744 input_class: AggregateInputClassV1::CanonicalScalarField,
745 no_value_rule: AggregateNoValueRuleV1::Excluded,
746 empty_result: AggregateEmptyResultV1::Absent,
747 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
748 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
749 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
750 operational_ir_tag: Some(15),
751 eligibility: BOUNDED_FOLD_ONLY,
752 budgets: EXACT_BUDGETS,
753 policy: EXACT_POLICY,
754 },
755 AggregateSemanticDescriptorV1 {
756 identity: AggregateSemanticIdentityV1::Max,
757 source_spelling: "last",
758 input_class: AggregateInputClassV1::CanonicalScalarField,
759 no_value_rule: AggregateNoValueRuleV1::Excluded,
760 empty_result: AggregateEmptyResultV1::Absent,
761 result_schema: AggregateResultSchemaV1::OptionalInputScalar,
762 partial_state: AggregatePartialStateV1::OptionalOrderedScalar,
763 arithmetic: AggregateArithmeticV1::FrozenTypedComparator,
764 operational_ir_tag: Some(16),
765 eligibility: BOUNDED_FOLD_ONLY,
766 budgets: EXACT_BUDGETS,
767 policy: EXACT_POLICY,
768 },
769 AggregateSemanticDescriptorV1 {
770 identity: AggregateSemanticIdentityV1::Sum,
771 source_spelling: "stddev",
772 input_class: AggregateInputClassV1::ExactNumericField,
773 no_value_rule: AggregateNoValueRuleV1::Excluded,
774 empty_result: AggregateEmptyResultV1::ExactNumericZero,
775 result_schema: AggregateResultSchemaV1::ExactDecimalAtInputScale,
776 partial_state: AggregatePartialStateV1::CheckedI128AtInputScale,
777 arithmetic: AggregateArithmeticV1::CheckedI128,
778 operational_ir_tag: Some(17),
779 eligibility: BOUNDED_FOLD_ONLY,
780 budgets: EXACT_BUDGETS,
781 policy: EXACT_POLICY,
782 },
783 AggregateSemanticDescriptorV1 {
784 identity: AggregateSemanticIdentityV1::CountPresent,
785 source_spelling: "collect",
786 input_class: AggregateInputClassV1::CanonicalScalarField,
787 no_value_rule: AggregateNoValueRuleV1::Excluded,
788 empty_result: AggregateEmptyResultV1::UnsignedZero,
789 result_schema: AggregateResultSchemaV1::BoundedInputScalarList,
790 partial_state: AggregatePartialStateV1::BoundedCanonicalSet,
791 arithmetic: AggregateArithmeticV1::CanonicalDistinctSet,
792 operational_ir_tag: Some(18),
793 eligibility: BOUNDED_FOLD_ONLY,
794 budgets: EXACT_DISTINCT_BUDGETS,
795 policy: EXACT_POLICY,
796 },
797 AggregateSemanticDescriptorV1 {
798 identity: AggregateSemanticIdentityV1::CountDistinctPresent,
799 source_spelling: "collect_distinct",
800 input_class: AggregateInputClassV1::CanonicalScalarField,
801 no_value_rule: AggregateNoValueRuleV1::Excluded,
802 empty_result: AggregateEmptyResultV1::UnsignedZero,
803 result_schema: AggregateResultSchemaV1::BoundedInputScalarList,
804 partial_state: AggregatePartialStateV1::BoundedCanonicalSet,
805 arithmetic: AggregateArithmeticV1::CanonicalDistinctSet,
806 operational_ir_tag: Some(19),
807 eligibility: BOUNDED_FOLD_ONLY,
808 budgets: EXACT_DISTINCT_BUDGETS,
809 policy: EXACT_POLICY,
810 },
811];
812
813#[must_use]
815pub const fn aggregate_semantic_registry_v1() -> &'static [AggregateSemanticDescriptorV1] {
816 &AGGREGATE_SEMANTIC_REGISTRY_V1
817}