Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
89eed55
v2.4.0 (#327)
singaraiona Jul 11, 2026
eb66eed
feat(query): support live inserts into parted tables
singaraiona Jul 14, 2026
bbdc419
fix(core): restore total-core -c semantics
singaraiona Jul 15, 2026
9961388
fix(parse) Fix nonstring if not defined
protocolstardust Jul 16, 2026
6cac6e8
Merge pull request #330 from protocolstardust/dev
protocolstardust Jul 16, 2026
f44ab81
Merge branch 'master' into dev
singaraiona Jul 16, 2026
49d8524
fix(store): surface FlushFileBuffers failure in journal SYNC mode (#335)
belowzeroff Jul 18, 2026
cb1c6cd
fix(hnsw): reject build dims whose vector count overflows size_t (#333)
belowzeroff Jul 18, 2026
7475949
fix(store): read full link sidecar to avoid wrong-symbol truncation (…
belowzeroff Jul 18, 2026
ebadd07
fix(hnsw): reject index files whose vector count overflows size_t (#332)
belowzeroff Jul 21, 2026
fa39d9d
fix(docs): remediate F-0001 F-0005 F-0007
singaraiona Jul 22, 2026
ffd784f
fix(docs): remediate CF-0001
singaraiona Jul 22, 2026
1f27e61
fix(docs): remediate CF-0002
singaraiona Jul 22, 2026
465e58e
chore(audit): plan CF-0003 ratification
singaraiona Jul 22, 2026
8f8033c
fix(docs): remediate CF-0003
singaraiona Jul 22, 2026
3ae79f5
feat(docs): redesign website and documentation
singaraiona Jul 22, 2026
5dc8265
Merge branch 'master' into dev
singaraiona Jul 22, 2026
4d2c8f3
fix(null): avoid f64 null casts to integers (#340)
belowzeroff Jul 23, 2026
4e49626
fix(expr): avoid null truthiness casts in fallback binary ops (#339)
belowzeroff Jul 23, 2026
a05886d
ci: make Rayforce audit PR comments best-effort
singaraiona Jul 23, 2026
6ca3d8a
ci: publish Rayforce audit comments from trusted workflow
singaraiona Jul 23, 2026
04d8f3d
ci: resolve fork PRs for audit commenter
singaraiona Jul 23, 2026
6acdc2c
perf: parallelize serial stages around group-by; unify binary-agg nul…
ser-vasilich Jul 23, 2026
a53d98e
Merge branch 'master' into dev
singaraiona Jul 23, 2026
260e018
fix(aggr): preserve slice nullability in binary groups
singaraiona Jul 23, 2026
492c5db
fix(expr): avoid f64 null cast in fallback idiv integer output (#344)
belowzeroff Jul 23, 2026
d250108
fix(group): avoid f64 null read cast in dense aggs (#343)
belowzeroff Jul 23, 2026
95f0a3d
fix(ipc): preserve boxed data list args (#346)
belowzeroff Jul 24, 2026
e10d1ab
fix(group): avoid f64 null cast in DA reads (#348)
belowzeroff Jul 24, 2026
842acc0
ci: use portable march for fuzz jobs (#347)
belowzeroff Jul 24, 2026
84cea17
chore(release): merge master into dev
singaraiona Jul 24, 2026
7a5839e
fix(pivot): preserve generic missing cells as null (#350)
belowzeroff Jul 27, 2026
57628fb
fix(xbar): avoid narrow bucket truncation (#351)
belowzeroff Jul 28, 2026
d7a1f6f
Merge branch 'master' into dev
singaraiona Jul 28, 2026
c501ae0
fix(arith): reject float temporal operands (#353)
belowzeroff Jul 29, 2026
aea9bda
fix(ops): make nested (LIST) columns usable through a parted view (fi…
singaraiona Jul 30, 2026
0605f1a
fix(query): preserve temporal arithmetic semantics (#354)
belowzeroff Jul 30, 2026
282d3a1
Merge branch 'master' into dev
singaraiona Jul 30, 2026
17bf2b8
ci: skip audit comments for cancelled runs
singaraiona Jul 30, 2026
05c8078
fix(query): preserve if temporal branch types (#359)
belowzeroff Jul 31, 2026
488a296
fix(store): reject duplicate splayed column names (#360)
belowzeroff Aug 3, 2026
5684559
fix(builtins): reject malformed strings in TIMESTAMP cast (#361)
belowzeroff Aug 3, 2026
c9b9a66
fix(store): support nested column inserts and persistence (#365)
singaraiona Aug 3, 2026
4c0fa46
fix(eval): enforce restricted mode in compiled lambdas (#366)
singaraiona Aug 3, 2026
8c9300b
feat(core): add bounded poll step for embedders (#367)
singaraiona Aug 3, 2026
3c79632
Merge branch 'master' into dev
singaraiona Aug 3, 2026
9b05f60
fix(test): rely on public runtime declarations (#369)
belowzeroff Aug 4, 2026
add3498
feat: website add consumer
singaraiona Aug 4, 2026
9d255c2
Merge branch 'master' into dev
singaraiona Aug 4, 2026
a1dcfd9
feat(core): expose restricted poll mode (#372)
singaraiona Aug 4, 2026
d5d5240
fix(aggr): preserve grouped nested first and last
singaraiona Aug 4, 2026
c35fa2b
Merge branch 'master' into dev
singaraiona Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/docs/guides/ipc.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,25 @@ The IPC layer is also accessible from C, enabling you to embed Rayforce clients
| `ray_ipc_send(handle, msg)` | Synchronous send: serialize `msg`, send, wait for response, return deserialized result. |
| `ray_ipc_send_async(handle, msg)` | Fire-and-forget send: serialize and send `msg` without waiting for a response. |
| `ray_ipc_close(handle)` | Close the connection and free the handle. |
| `ray_poll_set_restricted(poll, restricted)` | Make connections created afterward evaluate in restricted (read-only) mode. Call before servicing an embedded listener. |
| `ray_ipc_listen(poll, port)` | Register a server socket on the given poll loop. Used internally by `-p` mode. |

An embedded read-only server can use only the public, pointer-based API:

```c
ray_poll_t* poll = ray_poll_create();
ray_poll_set_restricted(poll, true);
ray_runtime_set_poll(poll);

ray_t* listener = ray_eval_str("(.sys.listen 7701)");
/* Check listener for an error, then service IPC from the host loop. */
ray_poll_run_for(poll, 200);
ray_release(listener);
```

The restriction applies to connections created after the setter call;
existing connections keep their original evaluation mode.

### Example: C Client

```c
Expand Down
6 changes: 6 additions & 0 deletions include/rayforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@ typedef struct ray_poll ray_poll_t;
ray_poll_t* ray_poll_create(void);
void ray_poll_destroy(ray_poll_t* poll);

/* Mark IPC evaluations on connections subsequently created by poll as
* restricted (read-only). Existing connections keep their original mode.
* Call from the thread that owns poll before servicing the listener.
* A NULL poll is ignored. */
void ray_poll_set_restricted(ray_poll_t* poll, bool restricted);

/* Run until ray_poll_exit is called. */
int64_t ray_poll_run(ray_poll_t* poll);

Expand Down
2 changes: 1 addition & 1 deletion src/app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int main(int argc, char** argv) {
pw_len = sizeof(poll->auth_secret) - 1;
memcpy(poll->auth_secret, auth_pw, pw_len);
poll->auth_secret[pw_len] = '\0';
poll->restricted = auth_restricted;
ray_poll_set_restricted(poll, auth_restricted);
}

/* Open journal BEFORE the IPC listener accepts any connection.
Expand Down
5 changes: 5 additions & 0 deletions src/core/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ void ray_poll_exit(ray_poll_t* poll, int64_t code)
if (poll) poll->code = code;
}

void ray_poll_set_restricted(ray_poll_t* poll, bool restricted)
{
if (poll) poll->restricted = restricted;
}

ray_selector_t* ray_poll_get(ray_poll_t* poll, int64_t id)
{
if (!poll || id < 0 || (uint32_t)id >= poll->n_sels)
Expand Down
1 change: 1 addition & 0 deletions src/core/poll.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct ray_poll {

ray_poll_t* ray_poll_create(void);
void ray_poll_destroy(ray_poll_t* poll);
void ray_poll_set_restricted(ray_poll_t* poll, bool restricted);
int64_t ray_poll_register(ray_poll_t* poll, ray_poll_reg_t* reg);
void ray_poll_deregister(ray_poll_t* poll, int64_t id);
int64_t ray_poll_run(ray_poll_t* poll);
Expand Down
141 changes: 96 additions & 45 deletions src/ops/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static inline bool sym_lex_gt(struct ray_sym_domain_s* dom,
return sym_lex_lt(dom, b, a);
}

/* ── Wide-element (STR/GUID) min/max/first/last ──────────────────────────
/* ── Row-gathered min/max/first/last ─────────────────────────────────────
* STR (a 16-byte ray_str_t: pool pointer + length) and GUID (16 raw bytes)
* do not fit the 8-byte integer reduce accumulators, so the int64 fast paths
* silently truncate them to a single byte. These helpers instead track the
Expand All @@ -158,6 +158,20 @@ static inline bool agg_is_wide_type(int8_t t) {
return t == RAY_STR || t == RAY_GUID;
}

/* Aggregates whose result must be materialised by gathering the winning
* source row instead of packing the input into an 8-byte numeric accumulator.
*
* LIST columns are boxed ray_t* cells. FIRST/LAST are well-defined for them,
* but the numeric emitters cannot construct a RAY_LIST with ray_vec_new (LIST
* is the special type tag 0) and must not reinterpret child pointers as i64.
* MIN/MAX remain limited to comparable STR/GUID elements. */
static inline bool agg_needs_row_gather(int8_t t, uint16_t op) {
if (t == RAY_LIST)
return op == OP_FIRST || op == OP_LAST;
return agg_is_wide_type(t) &&
(op == OP_MIN || op == OP_MAX || op == OP_FIRST || op == OP_LAST);
}

/* Group key/agg output columns are filled by copying ray_str_t descriptors
* (by source row index). Share the source column's string pool so pooled
* (>12 B) descriptors resolve against it (inline ≤12 B are self-contained). */
Expand Down Expand Up @@ -185,14 +199,24 @@ static int64_t wide_winner_row(ray_t* input, uint16_t op,
if (op == OP_FIRST) {
for (int64_t i = 0; i < scan_n; i++) {
int64_t row = sel ? sel[i] : i;
if (!has_nulls || !ray_vec_is_null(input, row)) return row;
if (input->type == RAY_LIST) {
ray_t* e = ((ray_t**)ray_data(input))[row];
if (e && !RAY_ATOM_IS_NULL(e)) return row;
} else if (!has_nulls || !ray_vec_is_null(input, row)) {
return row;
}
}
return -1;
}
if (op == OP_LAST) {
for (int64_t i = scan_n - 1; i >= 0; i--) {
int64_t row = sel ? sel[i] : i;
if (!has_nulls || !ray_vec_is_null(input, row)) return row;
if (input->type == RAY_LIST) {
ray_t* e = ((ray_t**)ray_data(input))[row];
if (e && !RAY_ATOM_IS_NULL(e)) return row;
} else if (!has_nulls || !ray_vec_is_null(input, row)) {
return row;
}
}
return -1;
}
Expand Down Expand Up @@ -224,14 +248,21 @@ static int64_t wide_winner_row(ray_t* input, uint16_t op,
}
return best;
}
/* Whole-table (optionally selected) min/max/first/last over a wide column. */
/* Whole-table (optionally selected) min/max/first/last over a row-gathered
* column, including boxed LIST cells. */
static ray_t* agg_wide_reduce(ray_t* input, uint16_t op,
const int64_t* sel, int64_t scan_n,
bool has_nulls) {
int64_t best = wide_winner_row(input, op, sel, scan_n, has_nulls);
if (best < 0) return ray_typed_null(-input->type);
if (best < 0)
return input->type == RAY_LIST
? ray_typed_null(-RAY_I64)
: ray_typed_null(-input->type);
int alloc;
return collection_elem(input, best, &alloc);
ray_t* result = collection_elem(input, best, &alloc);
/* collection_elem borrows boxed LIST cells; reductions return ownership. */
if (result && !alloc) ray_retain(result);
return result;
}

/* Integer reduction loop — reads native type T, accumulates as i64.
Expand Down Expand Up @@ -2521,12 +2552,13 @@ ray_t* ray_topk_per_group_buf(ray_t* src,

/* ─── ray_wide_minmax_per_group_buf ───────────────────────────────────────
*
* Per-group min/max/first/last for wide element types (STR/GUID) that don't
* fit the 8-byte integer accumulators. Same idx_buf/offsets/grp_cnt layout
* as the median/topk kernels — produced by exec_group's group-contiguous row
* gather — but instead of a numeric quickselect it finds the winning row per
* group (lexicographic for STR, byte order for GUID; positional for
* first/last) and materialises that element into a typed result column.
* Per-group min/max/first/last for elements that cannot flow through the
* 8-byte integer accumulators. Same idx_buf/offsets/grp_cnt layout as the
* median/topk kernels — produced by exec_group's group-contiguous row gather
* — but instead of a numeric quickselect it finds the winning row per group
* (lexicographic for STR, byte order for GUID; positional for first/last) and
* materialises that element into a typed result column. LIST elements retain
* the selected boxed child into a new owning list.
*
* Runs SERIAL: ray_str_vec_set COW-mutates the result vector and its shared
* string pool, so concurrent group writers would corrupt the pool. Wide
Expand All @@ -2537,17 +2569,28 @@ ray_t* ray_wide_minmax_per_group_buf(ray_t* src, uint16_t op,
const int64_t* grp_cnt,
int64_t n_groups) {
if (!src || RAY_IS_ERR(src) || n_groups < 0) return NULL;
if (!agg_is_wide_type(src->type)) return NULL; /* caller falls back */
if (!agg_needs_row_gather(src->type, op)) return NULL; /* caller falls back */
bool has_nulls = (src->attrs & RAY_ATTR_HAS_NULLS) != 0;

ray_t* out = col_vec_new(src, n_groups);
ray_t* out = src->type == RAY_LIST
? ray_list_new(n_groups)
: col_vec_new(src, n_groups);
if (!out || RAY_IS_ERR(out)) return out ? out : ray_error("oom", NULL);
out->len = n_groups;
/* LIST length advances with initialized child slots so every error path
* releases exactly the children whose ownership has been retained. */
out->len = src->type == RAY_LIST ? 0 : n_groups;

for (int64_t g = 0; g < n_groups; g++) {
int64_t cnt = grp_cnt[g];
int64_t off = offsets[g];
int64_t best = wide_winner_row(src, op, &idx_buf[off], cnt, has_nulls);
if (src->type == RAY_LIST) {
ray_t* e = best < 0 ? NULL : ((ray_t**)ray_data(src))[best];
if (e) ray_retain(e);
((ray_t**)ray_data(out))[g] = e;
out->len = g + 1;
continue;
}
if (best < 0) { ray_vec_set_null(out, g, true); continue; }
int alloc;
ray_t* e = collection_elem(src, best, &alloc);
Expand Down Expand Up @@ -2671,12 +2714,10 @@ ray_t* exec_reduction(ray_graph_t* g, ray_op_t* op, ray_t* input) {
}
}

/* Wide element types (STR/GUID) overflow the 8-byte reduce
* accumulators; resolve min/max/first/last by materialising the
/* Wide elements and boxed LIST cells cannot use the 8-byte reduce
* accumulators; resolve their supported operations by materialising the
* winning row instead. COUNT keeps the generic length-based path. */
if (agg_is_wide_type(in_type) &&
(op->opcode == OP_MIN || op->opcode == OP_MAX ||
op->opcode == OP_FIRST || op->opcode == OP_LAST)) {
if (agg_needs_row_gather(in_type, op->opcode)) {
ray_t* r = agg_wide_reduce(input, op->opcode, sel_idx, scan_n, has_nulls);
if (sel_idx_block) ray_release(sel_idx_block);
return r;
Expand Down Expand Up @@ -2974,14 +3015,12 @@ bool ght_compute_layout(ght_layout_t* out, uint32_t n_keys, uint32_t n_aggs,
* packed into entries or HT rows. A post-radix pass over
* row_gid+grp_cnt gathers per-group slices and runs the matching
* per-group kernel. */
/* Wide-element (STR/GUID) min/max/first/last also reserve no
* row-layout slot: the 8-byte accumulators can't hold a 16-byte
* GUID or a pooled string, so they are resolved by the same
/* Wide-element STR/GUID aggregates and boxed LIST first/last also
* reserve no row-layout slot: the 8-byte accumulators cannot hold
* their cells, so they are resolved by the same
* post-radix per-group pass via ray_wide_minmax_per_group_buf. */
bool wide_mm = agg_ops && agg_vecs[a] &&
agg_is_wide_type(agg_vecs[a]->type) &&
(agg_ops[a] == OP_MIN || agg_ops[a] == OP_MAX ||
agg_ops[a] == OP_FIRST || agg_ops[a] == OP_LAST);
agg_needs_row_gather(agg_vecs[a]->type, agg_ops[a]);
bool holistic = agg_ops && (agg_ops[a] == OP_MEDIAN ||
agg_ops[a] == OP_QUANTILE ||
agg_ops[a] == OP_MODE ||
Expand Down Expand Up @@ -5200,15 +5239,20 @@ static void emit_agg_columns(ray_t** result, ray_graph_t* g, const ray_op_ext_t*
out_type = is_f64 ? RAY_F64
: (agg_col ? agg_col->type : RAY_I64); break;
}
ray_t* new_col = ray_vec_new(out_type, (int64_t)grp_count);
/* LIST is the boxed collection tag (0), not a ray_vec_new element
* type. The scalar no-key path fills this placeholder below via the
* row-gather override; keyed LIST aggregates never reach this emitter. */
ray_t* new_col = out_type == RAY_LIST
? ray_list_new((int64_t)grp_count)
: ray_vec_new(out_type, (int64_t)grp_count);
if (!new_col || RAY_IS_ERR(new_col)) continue;
/* SYM MIN/MAX/FIRST/LAST: the emitted values are RAW cell ids
* accumulated from ONE source column — the output resolves over
* that column's dictionary (no-op while runtime-domain). */
if (out_type == RAY_SYM)
ray_sym_vec_adopt_domain(new_col, sym_domain_rep(agg_col));
new_col->len = (int64_t)grp_count;
for (uint32_t gi = 0; gi < grp_count; gi++) {
for (uint32_t gi = 0; out_type != RAY_LIST && gi < grp_count; gi++) {
size_t idx = (size_t)gi * n_aggs + a;
/* nn_counts[idx] == 0 means the group is all-null for this
* agg column — null-aware operators (MIN/MAX/PROD/FIRST/LAST/
Expand Down Expand Up @@ -9534,15 +9578,14 @@ static ray_t* exec_group_run(ray_graph_t* g, ray_op_t* op, ray_t* tbl,
m->count, agg_affine, agg_prod, m->sumsq_f64, m->nn_count,
NULL, NULL, NULL);

/* Wide-element (STR/GUID) min/max/first/last overflow emit_agg_columns'
* fixed-width slots (it truncated them to 1 byte above). Recompute
* those 1-row columns by materialising the winning row — mirroring
/* Row-gathered min/max/first/last cannot be represented in
* emit_agg_columns' fixed-width accumulator slots. Recompute those
* 1-row columns by materialising the winning row — mirroring
* exec_reduction — and override them in the result table. */
for (uint32_t a = 0; a < n_aggs; a++) {
uint16_t aop = ext->agg_ops[a];
if (!(agg_vecs[a] && agg_is_wide_type(agg_vecs[a]->type) &&
(aop == OP_MIN || aop == OP_MAX ||
aop == OP_FIRST || aop == OP_LAST)))
if (!(agg_vecs[a] &&
agg_needs_row_gather(agg_vecs[a]->type, aop)))
continue;
ray_t* wsel_blk = NULL; const int64_t* wsel = NULL; int64_t wscan = nrows;
if (g->selection) {
Expand All @@ -9556,11 +9599,18 @@ static ray_t* exec_group_run(ray_graph_t* g, ray_op_t* op, ray_t* tbl,
bool hn = (agg_vecs[a]->attrs & RAY_ATTR_HAS_NULLS) != 0;
ray_t* atom = agg_wide_reduce(agg_vecs[a], aop, wsel, wscan, hn);
if (wsel_blk) ray_release(wsel_blk);
ray_t* col = col_vec_new(agg_vecs[a], 1);
ray_t* col = agg_vecs[a]->type == RAY_LIST
? ray_list_new(1)
: col_vec_new(agg_vecs[a], 1);
if (col && !RAY_IS_ERR(col)) {
col->len = 1;
if (RAY_ATOM_IS_NULL(atom)) {
ray_vec_set_null(col, 0, true);
} else if (agg_vecs[a]->type == RAY_LIST) {
/* agg_wide_reduce returned an owned child reference;
* transfer it directly into the owning output list. */
((ray_t**)ray_data(col))[0] = atom;
atom = NULL;
} else if (agg_vecs[a]->type == RAY_STR) {
ray_t* nv = ray_str_vec_set(col, 0, ray_str_ptr(atom), ray_str_len(atom));
if (nv && !RAY_IS_ERR(nv)) col = nv;
Expand All @@ -9570,7 +9620,7 @@ static ray_t* exec_group_run(ray_graph_t* g, ray_op_t* op, ray_t* tbl,
ray_table_set_col_idx(result, a, col);
ray_release(col);
}
ray_release(atom);
if (atom) ray_release(atom);
}

/* Whole-table holistic aggregates have no n_keys==0 accumulator, so emit_agg_columns
Expand Down Expand Up @@ -9690,11 +9740,10 @@ da_path:;
if (aop == OP_MODE) da_eligible = false;
if (aop == OP_TOP_N) da_eligible = false;
if (aop == OP_BOT_N) da_eligible = false;
/* Wide-element (STR/GUID) min/max/first/last need the holistic
* post-fill; the DA emit (emit_agg_columns) would truncate them. */
if (agg_vecs[a] && agg_is_wide_type(agg_vecs[a]->type) &&
(aop == OP_MIN || aop == OP_MAX ||
aop == OP_FIRST || aop == OP_LAST))
/* Row-gathered aggregates need the holistic post-fill; the DA
* emitter cannot represent their source cells. */
if (agg_vecs[a] &&
agg_needs_row_gather(agg_vecs[a]->type, aop))
da_eligible = false;
}
for (uint32_t k = 0; k < n_keys && da_eligible; k++) {
Expand Down Expand Up @@ -11645,7 +11694,9 @@ v2_emit:;
out_type = is_f64 ? RAY_F64
: (agg_col ? agg_col->type : RAY_I64); break;
}
ray_t* new_col = ray_vec_new(out_type, (int64_t)total_grps);
ray_t* new_col = out_type == RAY_LIST
? ray_list_new((int64_t)total_grps)
: ray_vec_new(out_type, (int64_t)total_grps);
if (!new_col || RAY_IS_ERR(new_col)) {
agg_cols[a] = NULL;
memset(&agg_outs[a], 0, sizeof(agg_outs[a]));
Expand Down Expand Up @@ -12276,9 +12327,9 @@ sequential_fallback:;
: (agg_col ? agg_col->type : RAY_I64); break;
}
ray_t* new_col;
/* Drive off the layout bitmask, not the op literal: wide-element
* (STR/GUID) min/max/first/last are holistic too and their column
* lives in med_out[a], not the truncating row-layout read below. */
/* Drive off the layout bitmask, not the op literal: row-gathered
* STR/GUID/LIST aggregates are holistic too and their column lives
* in med_out[a], not the truncating row-layout read below. */
bool is_holistic = (ly->agg_flags[a] & GHT_AF_HOLISTIC) != 0;
if (is_holistic && med_out && med_out[a]
&& !RAY_IS_ERR(med_out[a])) {
Expand Down
19 changes: 19 additions & 0 deletions test/rfl/system/part.rfl
Original file line number Diff line number Diff line change
Expand Up @@ -374,5 +374,24 @@
(count (at Pac 'part)) -- 4
(.sys.exec "rm -rf /tmp/rfl_part_atcol")

;; ────────────── grouped FIRST/LAST on persisted nested columns (#373) ────────
;; LIST columns loaded from a parted table contain boxed ray_t* cells. Their
;; aggregate result must be gathered as an owned child object; sending them
;; through the fixed-width numeric emitter used to omit the column entirely
;; and shift every following output name.
(.sys.exec "rm -rf /tmp/rfl_part_nested")
(set PN-A (table [g nested c1 c2] (list [a a b] (list (dict (as 'i64 (list 0)) (as 'f64 (list 5))) (dict (as 'i64 (list 0 250000)) (as 'f64 (list 15 10))) (dict (as 'i64 (list 0)) (as 'f64 (list 7)))) (as 'i64 (list 1 2 3)) (as 'i64 (list 4 5 6)))))
(set PN-B (table [g nested c1 c2] (list [a b] (list (dict (as 'i64 (list 0)) (as 'f64 (list 20))) (dict (as 'i64 (list 0)) (as 'f64 (list 9)))) (as 'i64 (list 8 9)) (as 'i64 (list 10 11)))))
(.db.splayed.set "/tmp/rfl_part_nested/2024.01.01/t/" PN-A)
(.db.splayed.set "/tmp/rfl_part_nested/2024.01.02/t/" PN-B)
(set Pnested (.db.parted.get "/tmp/rfl_part_nested/" 't))
(set Rnested (select {n: (last nested) c1: (last c1) c2: (last c2) from: Pnested by: g}))
(key Rnested) -- [g n c1 c2]
(at Rnested 'c1) -- [8 9]
(at Rnested 'c2) -- [10 11]
(at (at (at Rnested 'n) 0) 0) -- 20.0
(at (at (at Rnested 'n) 1) 0) -- 9.0
(.sys.exec "rm -rf /tmp/rfl_part_nested")

;; ────────────── teardown ──────────────
(.sys.exec "rm -rf /tmp/rfl_part_date /tmp/rfl_part_int /tmp/rfl_part_sym /tmp/rfl_part_single /tmp/rfl_part_empty /tmp/rfl_part_missing /tmp/rfl_part_three /tmp/rfl_part_cd /tmp/rfl_part_cd_sym /tmp/rfl_part_minute /tmp/rfl_part_like /tmp/rfl_part_mc /tmp/rfl_part_mb")
Loading
Loading