@pythia-software/query-table-core 0.4.2 → 0.6.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/README.md CHANGED
@@ -44,6 +44,11 @@ Text filters include `matches_regex` / `not_matches_regex`. An order term may
44
44
  set `extract: { regex: "..." }` to compare the first capture group (or the whole
45
45
  match when there is no capture group); non-matches sort as nulls.
46
46
 
47
+ Text fields also support `length_gt`, `length_lt`, and `length_eq` with a
48
+ non-negative integer value. Length counts Unicode code points. `length_eq` with
49
+ `"0"` matches empty strings but excludes NULL; `length_gt` with `"0"` matches
50
+ nonempty strings.
51
+
47
52
  See the [repository README](https://github.com/Pythia-Software/query-table#readme)
48
53
  for the complete schema and backend documentation.
49
54
 
@@ -54,3 +59,54 @@ Exports include `ComputedColumnStore`, `httpComputedColumnStore`, `memoryCompute
54
59
  For case-sensitive array keys, set `filter: { arrayCaseSensitive: true }` on the
55
60
  `textarray` field. The default remains case-insensitive. This setting applies to
56
61
  local filtering and metrics and to PostgreSQL array membership.
62
+
63
+ Datetime comparisons accept signed elapsed offsets such as `-1h`, `+8d2h10m`,
64
+ and `+0s`. Operators and the wire shape are unchanged: values remain relative in
65
+ saved queries and requests, and the server resolves them when compiling. Local
66
+ executors mirror this behavior and accept an optional clock for deterministic
67
+ execution. See [relative datetime operands](https://github.com/Pythia-Software/query-table/blob/main/docs/relative-time.md).
68
+
69
+ ## Local metric resource and precision boundaries
70
+
71
+ `evaluateMetrics` checks grouping storage before serializing each tuple.
72
+ `maxGroupKeyLength` defaults to 65,536 escaped JSON UTF-16 code units per tuple;
73
+ `maxGroupBytes` defaults to 16,000,000 estimated bytes per metric. The byte
74
+ estimate includes serialized keys, original string payloads (charged per group
75
+ even when shared), tuple slots, map/bucket overhead, and 16 bytes per retained
76
+ row reference. It also reserves a candidate group and serialization scratch
77
+ before lookup, including for duplicate keys. These conservative bounds can
78
+ reject a population below its actual heap limit; they are not heap measurements.
79
+ Ungrouped rows also consume the row-reference budget. Bounds must be nonnegative
80
+ safe integers. Exceeding a bound returns an explicit metric error with no partial
81
+ buckets. Existing row, group-count, operation, and distinct-value budgets remain
82
+ independent. Group limits apply after evaluation and do not bypass these bounds.
83
+ Keys preserve scalar types, and long field values remain valid within the tuple
84
+ and byte limits; field values are never truncated.
85
+
86
+ Numeric SUM, AVG, MIN, MAX and numeric COUNT_DISTINCT samples must be finite and,
87
+ when integral, within ±9,007,199,254,740,991. SUM and AVG check each accumulation
88
+ step; aggregate results, consumed worker reductions, and final metric expression
89
+ results follow the same boundary. Unsafe samples fail even when cancellation,
90
+ averaging, or selecting an extremum could produce a safe result. COUNT counts
91
+ presence and does not interpret the input's numeric magnitude. Text/date extrema
92
+ keep their existing semantics. Distribution samples, percentile outputs, box
93
+ summary statistics, and histogram boundaries use the same numeric rule. Invalid
94
+ box samples produce group errors; any invalid histogram sample invalidates the
95
+ shared extent. NULL remains an excluded sample, not an error. Lazy IF/COALESCE
96
+ branches do not observe unused reduction failures; IFERROR can recover from a
97
+ numeric failure.
98
+
99
+ These are IEEE-754 display-arithmetic semantics, **not exact decimal arithmetic**.
100
+ Finite nonintegral values (including small/subnormal values) remain supported;
101
+ floating-point rounding still applies. `coverage: 'exact'` means the complete
102
+ scoped population was processed, not that every arithmetic operation was exact.
103
+ Row-expression arithmetic retains the formula engine's own semantics; these
104
+ checks apply at sample/reduction/result boundaries, not to every intermediate
105
+ formula node.
106
+
107
+ The Go `qt-postgres-v1` profile requires explicit `ExpressionNumeric` bindings and
108
+ restricts nonzero magnitudes to 1e-300–1e100. Its numeric metric sample/reduction/result guards reject unsafe integers, including AVG/MIN/MAX and distributions. COUNT retains presence semantics. It accumulates SUM/AVG through
109
+ PostgreSQL numeric and also conservatively bounds SUM's absolute population sum.
110
+ Do not claim identical acceptance, intermediate overflow, or bit-for-bit numeric
111
+ parity; negotiate the backend profile and compare supported floating results
112
+ with tolerances. The host must enforce the negotiated profile and execution budgets.