1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Copyright (c) 2025-2026 Anton Kundenko <singaraiona@gmail.com>
* All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* table.h -- Table operations.
*
* A table has type = RAY_TABLE (98), len = current column count.
* Data region: first sizeof(ray_t*) bytes = pointer to schema (I64 vector
* of column name symbol IDs), then ncols * sizeof(ray_t*) = column vector
* pointers.
*/
/* Rows of a parted wrapper: the sum of its present segments' lengths (a
* MAPCOMMON: the sum of its row counts; anything else: len). A wrapper from
* ray_read_parted has every segment, a ragged partition's absent column
* a segment of nulls of the partition's row count, so this is the table's row count
* (#724). A missing segment (hand-built wrappers only) counts 0 rows; the
* executor refuses a table whose parted and MAPCOMMON row counts differ. */
int64_t ;
/* Logical rows of any column object (plain, parted wrapper, MAPCOMMON,
* RAY_ENCCOL) without decoding. */
int64_t ;
typedef struct ray_col_meta_t;
bool ; /* any slot object */
bool ;
/* Whether `tbl` (a table) has column `name_id`, from metadata: an encoded
* column is not materialized. */
bool ;
bool ;
/* Index of a column without decoding when it cannot carry one: NULL with
* *index set (borrowed RAY_INDEX block or NULL), or an owned error. */
ray_t* ;
ray_t* ;
/* The borrowed RAY_ENCCOL object of a slot, or NULL (absent, plain). */
ray_t* ;
ray_t* ;
/* The slot object itself, plain or encoded (borrowed; never decodes), or
* NULL when absent: for handing a column to another table unread. */
ray_t* ;
ray_t* ;
/* Segment s of a parted slot (borrowed; never decodes): the encoded
* wrapper's segment object or the plain wrapper's segment. NULL when the
* slot is absent or not parted, s is out of range, or the segment is
* missing (a hand-built wrapper). */
ray_t* ;
ray_t* ;
/* Null presence from metadata; never materializes. */
bool ;
/* The table's column list for an in-place value write, or NULL when the
* table is not a table or any slot holds a RAY_ENCCOL (callers then take
* their copy route). Ownership checks (rc) stay with the caller. */
ray_t* ;
/* The column-list container is canonical: a RAY_LIST with zero attrs whose
* length is the schema's. Reads only the container header, never a slot. */
bool ;
/* RAY_TABLE_H */