diff --git a/src/arcadedb/_columnar.py b/src/arcadedb/_columnar.py index 63f5816f..ba00a7ec 100644 --- a/src/arcadedb/_columnar.py +++ b/src/arcadedb/_columnar.py @@ -5,8 +5,11 @@ vector, ``dim``), then for each column its null bitmap (bit i of byte i/8 set means row i is null) and its buffer. A column type is ``i8`` (int64), ``f8`` (float64), ``b1`` (one byte per bool), ``dt`` and ``dtu`` (int64 epoch milliseconds and microseconds), ``f4v`` and ``f8v`` (``dim`` floats per row), ``str`` (int32 offsets, count + 1 of them, then the UTF-8 bytes: Arrow's own string -layout), ``dec`` (a BigDecimal as text in the string layout) and ``json`` (a JSON array of the column, for values no fixed layout -carries: nested lists and maps, RIDs, a DATE next to datetimes, a mixed column). +layout), ``dec`` (a BigDecimal as text in the string layout), ``rid`` (two int64 per row: the bucket and the position of a record +link), ``li8`` and ``lf8`` (a list of int64 or of float64 per row: int32 offsets, count + 1 of them, a bitmap of the null elements, one +bit per element of the flat array, then the elements of every list one after the other) and ``json`` (a JSON array of the column, for +values no fixed layout carries: maps, nested lists, lists of anything else, embedded records, a DATE next to datetimes, a mixed +column). A writer that does not know ``rid``, ``li8`` and ``lf8`` writes ``json`` for those columns, and the decoder reads both. The interface and the format are shared, the plumbing is per wheel: what differs is how the bytes get here (JPype or ctypes) and the text of a ``json`` column (the JVM wheel's tagged JSON with a side array of Java objects, the native library's tagged JSON), so the @@ -66,6 +69,34 @@ def _decode_decimals(data, count: int, mask) -> list: ] +def rid_texts(pairs) -> list: + """The RID texts (``"#bucket:position"``) of the ``(count, 2)`` int64 array of a ``rid`` column.""" + return [f"#{b}:{p}" for b, p in pairs.tolist()] + + +def _decode_list_column(data, count: int, ctype: str): + """``(offsets, flat, null_elements)`` of a ``li8`` or ``lf8`` column buffer: int32 offsets (count + 1), the bitmap of the null + elements, then the flat int64 or float64 array of every list's elements. ``null_elements`` is a bool array (True = null) or None + when no element is null.""" + import numpy as np + + offs = np.frombuffer(data[: (count + 1) * 4], dtype=" Tuple[Dict[str, Any], int]: def decode_columns_frame( - buf, side, json_values: Callable, micros: bool = False + buf, side, json_values: Callable, micros: bool = False, rid_values: Callable = None ) -> Tuple[int, Dict[str, Any], Dict[str, Any]]: """``(count, parts, header)`` of one frame as ``to_columns`` columns: ``parts`` maps a column name to a numpy array (int64, float64, bool, datetime64) or a Python list (text, JSON-typed values, a bool column with nulls); a count of 0 has @@ -261,6 +292,10 @@ def decode_columns_frame( ``micros`` is the ``to_dataframe`` form: a naive datetime column is ``datetime64[us]`` (``dtu``), and a vector column is a list with one numpy array per cell and None for a null (a NaN row would read as a vector of NaN, not as a missing value). + + A ``rid`` column is a list of what ``rid_values(pairs, side, col)`` makes of the ``(count, 2)`` int64 array of its cells (the + wheel's own RID object; the null rows are set to None here), or of the RID texts without it. A ``li8`` or ``lf8`` column is a list + of Python lists (ints or floats, None for a null element), None for a null row. """ import numpy as np @@ -319,6 +354,27 @@ def decode_columns_frame( values = [ None if has_nulls and mask[i] else values[i] for i in range(count) ] + elif ctype == "rid": + pairs = np.frombuffer(data, dtype=" or list over the frame's own offsets and flat array, with a validity for null rows and elements + offs, flat, emask = _decode_list_column(data, count, ctype) + child = pa.array(flat, mask=emask) + validity = ( + None if not has_nulls else pa.py_buffer(np.invert(null_bits).tobytes()) + ) + arr = pa.ListArray.from_buffers( + pa.list_(child.type), + count, + [validity, pa.py_buffer(offs.tobytes())], + children=[child], + ) elif ctype == "json": values = json_values(data, side, count) try: diff --git a/src/arcadedb/_native/colframes.py b/src/arcadedb/_native/colframes.py index 31e47cc0..c1f55654 100644 --- a/src/arcadedb/_native/colframes.py +++ b/src/arcadedb/_native/colframes.py @@ -4,7 +4,8 @@ the shared decoder reads. The first reply of a query (up to ``_FIRST_BATCH`` rows) is JSON text that the row APIs read, and a columnar read finds those rows (and any the caller read by row) as dicts in the result's buffer. They cannot be read again from the cursor, so they are written here as one more frame, in the layout the library writes, by the rules the library's encoder follows, and read by the same -decoder: a column has one type however a result splits into the first reply and frames. The JSON reply names the properties that were +decoder: a column has one type however a result splits into the first reply and frames. A column of RIDs, or of lists of numbers, is a +``json`` column here, and a frame of the library may carry it as ``rid``, ``li8`` or ``lf8``: the decoder gives the same values for both forms. The JSON reply names the properties that were ``float[]`` or ``double[]`` (``fv`` and ``dv``): a list of numbers in a row cannot say that by itself, and a vector column is a column of declared arrays, not a column of lists that happen to fit float32. This frame goes away with the JSON reply. """ @@ -15,7 +16,7 @@ from decimal import Decimal from .. import _columnar -from .codec import loads_tagged +from .codec import RID, loads_tagged _EPOCH = datetime(1970, 1, 1) _MS = timedelta(milliseconds=1) @@ -29,6 +30,12 @@ def json_values(data, side, count): return loads_tagged(bytes(data).decode("utf-8"))[0] +def rid_objects(pairs, side, col): + """The RID objects of a ``rid`` column of a frame from the library: its bucket and position pairs, as the native build's ``RID`` of the text + the tagged JSON of a link value gives.""" + return [RID(text) for text in _columnar.rid_texts(pairs)] + + def _head_json_values(data, side, count): """The values of a ``json`` column of the head frame: the buffered values themselves, by the index the column carries.""" return side[int.from_bytes(bytes(data), "little")] @@ -182,7 +189,9 @@ def _head_frame(rows, columns, hints, micros): def decode_columns(raw, micros): - return _columnar.decode_columns_frame(memoryview(raw), (), json_values, micros) + return _columnar.decode_columns_frame( + memoryview(raw), (), json_values, micros, rid_objects + ) def decode_arrow(raw): @@ -196,7 +205,7 @@ def columns_result(head_rows, columns, micros, batches, hints): if head_rows: frame, side = _head_frame(head_rows, columns, hints, micros) count, parts, _ = _columnar.decode_columns_frame( - frame, side, _head_json_values, micros + frame, side, _head_json_values, micros, rid_objects ) names.extend(parts) parts_list.append((count, parts)) diff --git a/src/arcadedb/results.py b/src/arcadedb/results.py index d398511d..18614df0 100644 --- a/src/arcadedb/results.py +++ b/src/arcadedb/results.py @@ -22,6 +22,7 @@ frame_rows, merge_arrow, merge_columns, + rid_texts, ) from ._logging import get_logger from .callbacks import raise_pending_interrupt @@ -103,6 +104,16 @@ def hook(obj): return hook +def _typed_rid_values(pairs, side, col): + """The engine's RID objects of a ``rid`` column of a ColumnBatcher frame: the bridge puts them into the side array in row order from + the index ``col["side"]`` (an RID is a record link of a database, which a bucket and a position cannot be turned back into here). + """ + start = col.get("side") + if start is None: + return rid_texts(pairs) + return [convert_java_to_python(side[start + i]) for i in range(len(pairs))] + + def _typed_json_values(data, side, count): """The values of a ``json`` column of a ColumnBatcher frame: the tagged JSON (TypedRows) with its side array of Java objects.""" return json.loads(bytes(data), object_hook=_typed_hook(side)) @@ -894,7 +905,7 @@ def _read_columns_counted(self, batch_size, columns, micros): raise _read_error(exc) from exc buf = memoryview(bytes(java_batch[0])) count, parts, _ = decode_columns_frame( - buf, java_batch[1], _typed_json_values, micros + buf, java_batch[1], _typed_json_values, micros, _typed_rid_values ) if count == 0: self._finish() diff --git a/src/java/com/arcadedb/python/ColumnBatcher.java b/src/java/com/arcadedb/python/ColumnBatcher.java index 168b2851..57368f27 100644 --- a/src/java/com/arcadedb/python/ColumnBatcher.java +++ b/src/java/com/arcadedb/python/ColumnBatcher.java @@ -6,7 +6,10 @@ * little-endian for numerics/bools/temporals (epoch millis), offset+UTF-8 * for strings, plus a null bitmap per column. A DECIMAL column ("dec" type) uses the string layout with each * BigDecimal written in full, so no digit is lost to a double. Columns whose values don't - * fit those encodings are serialized as one JSON array ("json" type). Python decodes with numpy.frombuffer + * fit those encodings are serialized as one JSON array ("json" type). A column of record links is "rid" (two int64 per row: + * bucket and position) and a column of lists of integers or of floats is "li8" or "lf8" (int32 offsets, a bitmap of the null + * elements, then one flat int64 or float64 array); maps, nested lists, lists of anything else and the rest stay "json". + * Python decodes with numpy.frombuffer * (ResultSet.to_columns / the fast to_dataframe path). Measured ~1.2x of * Java-native iteration on 100k-row scans (vs 3.4x for the JSON row path). * @@ -19,6 +22,7 @@ */ package com.arcadedb.python; +import com.arcadedb.database.RID; import com.arcadedb.query.sql.executor.Result; import com.arcadedb.query.sql.executor.ResultSet; import com.arcadedb.serializer.json.JSONArray; @@ -87,6 +91,55 @@ private static boolean yearFits(final LocalDateTime ldt) { return ldt.getYear() >= 1 && ldt.getYear() <= 9999; } + /** + * The column kind of one list: "li8" (every element a Long, Integer, Short or Byte, or null), "lf8" (every element a Double or Float, or + * null), "l0" (no element that is not null: it takes the kind of the other lists of the column) or "json" (a string, a boolean, a + * nested value, ints next to floats: what no fixed layout carries without changing a value). + */ + private static String listKind(final List list) { + String kind = "l0"; + for (final Object e : list) { + if (e == null) + continue; + final String k; + if (e instanceof Long || e instanceof Integer || e instanceof Short || e instanceof Byte) + k = "li8"; + else if (e instanceof Double || e instanceof Float) + k = "lf8"; + else + return "json"; + if (kind.equals("l0")) + kind = k; + else if (!kind.equals(k)) + return "json"; + } + return kind; + } + + private static boolean isListKind(final String kind) { + return kind.equals("li8") || kind.equals("lf8") || kind.equals("l0"); + } + + /** The kind of a column that holds lists of kind {@code a} and of kind {@code b}, or null when no list layout carries both. */ + private static String mergeListKinds(final String a, final String b) { + if (!isListKind(a) || !isListKind(b)) + return null; + if (a.equals(b) || b.equals("l0")) + return a; + if (a.equals("l0")) + return b; + return null; // ints next to floats: each element keeps its own type in a json column + } + + /** The elements of the lists of a column of list kind (the size of the flat buffer), or -1 when the buffer would not fit an int32 offset. */ + private static long listElements(final List rows, final int c, final int count) { + long total = 0; + for (int r = 0; r < count; r++) + if (rows.get(r)[c] instanceof List l) + total += l.size(); + return total <= (1 << 27) ? total : -1; + } + /** The columns of up to {@code max} rows, temporals in milliseconds: {@code {byte[] buffer, Object[] side}}. */ public static Object[] nextColumnBatch(final ResultSet rs, final int max, final String joinedColumns) { return nextColumnBatch(rs, max, joinedColumns, false); @@ -188,13 +241,21 @@ else if (v instanceof float[]) t = "f4v"; else if (v instanceof double[]) t = "f8v"; + else if (v instanceof RID rid) + // a record link: bucket and position, which write the text of the RID ("#b:p") for a valid RID + t = rid.getBucketId() >= 0 && rid.getPosition() >= 0 ? "rid" : "json"; + else if (v instanceof List list) + t = listKind(list); else t = "json"; if (type == null) type = t; else if (!type.equals(t)) { + final String merged = mergeListKinds(type, t); // numeric widening is fine; anything else degrades to json - if ((type.equals("i8") && t.equals("f8")) || (type.equals("f8") && t.equals("i8"))) + if (merged != null) + type = merged; + else if ((type.equals("i8") && t.equals("f8")) || (type.equals("f8") && t.equals("i8"))) type = "f8"; else { type = "json"; @@ -204,6 +265,8 @@ else if (!type.equals(t)) { } if (type == null) type = "str"; // all-null column + if (type.equals("l0")) + type = "json"; // lists with no element that is not null say nothing about the element type: Arrow types them list // an integer beyond 2**53 next to a floating value has no exact double: the values stay what they are, in a json column if (type.equals("f8") && sawInt && sawFloating && bigInt) type = "json"; @@ -225,6 +288,14 @@ else if (vdim != len) type = "json"; } + long listTotal = 0; + if (type.equals("li8") || type.equals("lf8")) { + listTotal = listElements(rows, c, count); + if (listTotal < 0) + type = "json"; + } + int ridSide = -1; + byte[] colBuf; if (type.equals("i8") || type.equals("dt") || type.equals("dtu")) { final ByteBuffer bb = ByteBuffer.allocate(count * 8).order(ByteOrder.LITTLE_ENDIAN); @@ -289,6 +360,59 @@ else if (type.equals("dtu")) bb.putDouble(x); } colBuf = bb.array(); + } else if (type.equals("rid")) { + // bucket and position as two int64 per row; a null row is 0, 0. The engine's RID objects go to the side array too, in row + // order from the index the header names ("side"): to_columns hands out the engine's own RID, which a numeric pair cannot be + // turned back into on this side of the bridge without the database; to_arrow reads the pairs and never touches the array + ridSide = side.size(); + final ByteBuffer bb = ByteBuffer.allocate(count * 16).order(ByteOrder.LITTLE_ENDIAN); + for (int r = 0; r < count; r++) { + final Object v = rows.get(r)[c]; + side.add(v); + if (v == null) { + nulls[r >> 3] |= (1 << (r & 7)); + bb.putLong(0); + bb.putLong(0); + } else { + bb.putLong(((RID) v).getBucketId()); + bb.putLong(((RID) v).getPosition()); + } + } + colBuf = bb.array(); + } else if (type.equals("li8") || type.equals("lf8")) { + // int32 offsets (count + 1), a bitmap of the null elements (bit j of byte j/8 set for a null element, one bit per element of + // the flat array), then the elements of every list one after the other, int64 or float64 LE. A null row is an empty list. + final boolean ints = type.equals("li8"); + final ByteBuffer offs = ByteBuffer.allocate((count + 1) * 4).order(ByteOrder.LITTLE_ENDIAN); + final ByteBuffer vals = ByteBuffer.allocate((int) listTotal * 8).order(ByteOrder.LITTLE_ENDIAN); + final byte[] elemNulls = new byte[(int) ((listTotal + 7) / 8)]; + int pos = 0; + offs.putInt(0); + for (int r = 0; r < count; r++) { + final Object v = rows.get(r)[c]; + if (v == null) + nulls[r >> 3] |= (1 << (r & 7)); + else + for (final Object e : (List) v) { + if (e == null) { + elemNulls[pos >> 3] |= (1 << (pos & 7)); + if (ints) + vals.putLong(0); + else + vals.putDouble(Double.NaN); + } else if (ints) + vals.putLong(((Number) e).longValue()); + else + vals.putDouble(((Number) e).doubleValue()); + pos++; + } + offs.putInt(pos); + } + final ByteBuffer bb = ByteBuffer.allocate(offs.capacity() + elemNulls.length + vals.capacity()); + bb.put(offs.array()); + bb.put(elemNulls); + bb.put(vals.array()); + colBuf = bb.array(); } else if (type.equals("json")) { // one JSON array for the whole column, in the tagged encoding of TypedRows: what the engine's JSON writer turns // into epoch milliseconds, a double or a text key (a date or Decimal in a list, an int map key) stays what the @@ -337,6 +461,8 @@ else if (type.equals("dtu")) columnHeader.put("bytes", colBuf.length); if (vdim > 0 && (type.equals("f4v") || type.equals("f8v"))) columnHeader.put("dim", vdim); + if (ridSide >= 0) + columnHeader.put("side", ridSide); headerColumns.put(columnHeader); body.write(nulls, 0, nulls.length); body.write(colBuf, 0, colBuf.length); diff --git a/tests/fixtures/frame_kinds_post3.json b/tests/fixtures/frame_kinds_post3.json new file mode 100644 index 00000000..c1f4c937 --- /dev/null +++ b/tests/fixtures/frame_kinds_post3.json @@ -0,0 +1,1540 @@ +{ + "jvm": { + "backend": "jvm", + "g1": { + "to_arrow:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "string" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "struct" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list>" + } + }, + "to_arrow:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "string" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "struct" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list>" + } + }, + "to_columns:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "list" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list" + } + }, + "to_columns:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "list" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list" + } + }, + "to_dataframe:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "object" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "object" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "object" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "object" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "object" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "object" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "object" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "object" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "object" + } + }, + "to_polars:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "List(Boolean)" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "List(Null)" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "List(Float64)" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "List(Int64)" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "List(Float64)" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "List(Float64)" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "List(String)" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "String" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "Struct({'a': Int64, 'b': String})" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "List(List(Int64))" + } + }, + "to_polars:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "List(Boolean)" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "List(Null)" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "List(Float64)" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "List(Int64)" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "List(Float64)" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "List(Float64)" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "List(String)" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "String" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "Struct({'a': Int64, 'b': String})" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "List(List(Int64))" + } + } + }, + "g2": { + "to_arrow:100": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "string" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "string" + }, + "rls": { + "n": 700, + "sha": "03557dbb7c94f59adb60417f782105170ac3796ae24da32ed4c4bb4de1efdcaf", + "type": "string" + } + }, + "to_arrow:25000": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "string" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "string" + }, + "rls": { + "n": 700, + "sha": "03557dbb7c94f59adb60417f782105170ac3796ae24da32ed4c4bb4de1efdcaf", + "type": "string" + } + }, + "to_columns:100": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "list" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "list" + } + }, + "to_columns:25000": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "list" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "list" + } + }, + "to_dataframe:25000": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "object" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "object" + } + }, + "to_polars:100": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "String" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "String" + }, + "rls": { + "n": 700, + "sha": "03557dbb7c94f59adb60417f782105170ac3796ae24da32ed4c4bb4de1efdcaf", + "type": "String" + } + }, + "to_polars:25000": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "String" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "String" + }, + "rls": { + "n": 700, + "sha": "03557dbb7c94f59adb60417f782105170ac3796ae24da32ed4c4bb4de1efdcaf", + "type": "String" + } + } + }, + "g3": { + "to_arrow:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_arrow:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_columns:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_columns:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_dataframe:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "object" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_polars:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "List(Float64)" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "List(Int64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + }, + "to_polars:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "List(Float64)" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "List(Int64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + } + }, + "g4": { + "to_arrow:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_arrow:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_columns:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_columns:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_dataframe:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_polars:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "List(Float64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + }, + "to_polars:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "List(Float64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + } + }, + "rid_type": "com.arcadedb.database.com.arcadedb.database.DatabaseRID", + "version": "26.11.1.post3" + }, + "native": { + "backend": "native", + "g1": { + "to_arrow:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "string" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "struct" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list>" + } + }, + "to_arrow:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "string" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "struct" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list>" + } + }, + "to_columns:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "list" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list" + } + }, + "to_columns:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "list" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "list" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "list" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "list" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "list" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "list" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "list" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "list" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "list" + } + }, + "to_dataframe:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "object" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "object" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "object" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "object" + }, + "lm": { + "n": 700, + "sha": "4b69ed220e03aa9ad65bc960c4117d9cd33e76fc3f1588fc103095311766ba55", + "type": "object" + }, + "lmix": { + "n": 700, + "sha": "cd2ba5b276017883d110a6a93007983c85a9ede20d432cc413e40e5a9f618249", + "type": "object" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "object" + }, + "mixc": { + "n": 700, + "sha": "67d56b52edd1a8aaa5d0e81a6959db3fdfab4f3c531056ffb9785dae54098359", + "type": "object" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "object" + } + }, + "to_polars:100": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "List(Boolean)" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "List(Null)" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "List(Float64)" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "List(Int64)" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "List(Float64)" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "List(Float64)" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "List(String)" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "String" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "Struct({'a': Int64, 'b': String})" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "List(List(Int64))" + } + }, + "to_polars:25000": { + "lb": { + "n": 700, + "sha": "c693f5d2610d716b2b56794832dc7f134d62e541400f7ed8a8b8fe4a67436a4e", + "type": "List(Boolean)" + }, + "le": { + "n": 700, + "sha": "fbae76ca22ed13531408879f6b50081e1c49f0669004c26850251133b7f382b4", + "type": "List(Null)" + }, + "lf": { + "n": 700, + "sha": "59bf4bbfda9304ea12c4564ddd04fc7d728295db0e3dd01ccbb7ae536e746c84", + "type": "List(Float64)" + }, + "li": { + "n": 700, + "sha": "91f316ebe5070c52ae3488a090a7f1affc3123df775d3b826e81e7ad6095697c", + "type": "List(Int64)" + }, + "lm": { + "n": 700, + "sha": "82b98b74049200ef9c6029e682ccf323bb48688d4d41dd91323c262570af508a", + "type": "List(Float64)" + }, + "lmix": { + "n": 700, + "sha": "f142cb9a8291ce1b990869f05e5d1764dc1bf599d1f8c11e0f4f13529b5d8cd3", + "type": "List(Float64)" + }, + "ls": { + "n": 700, + "sha": "a2693ca205ea2202723039fba87ad8eadf880351d933125ffcc4fb7b6d5585f2", + "type": "List(String)" + }, + "mixc": { + "n": 700, + "sha": "a55948f65aae73fdad0bd25c719d31ba725e7e2ca5303c2020bb9f1bf7f948cf", + "type": "String" + }, + "mp": { + "n": 700, + "sha": "444c3baf0091b11a442ebca86d122750059704363782d08406afb34d044b04d7", + "type": "Struct({'a': Int64, 'b': String})" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "nl": { + "n": 700, + "sha": "6bab46b549b85054c2187fed18a0e00c913b557ff648f670055558eed80e142b", + "type": "List(List(Int64))" + } + } + }, + "g2": { + "to_arrow:100": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "string" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "string" + }, + "rls": { + "n": 700, + "sha": "f679ccfebbc736a35508ac4223934c516bd58e8b0352c3d753bdacede1a00243", + "type": "string" + } + }, + "to_arrow:25000": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "string" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "string" + }, + "rls": { + "n": 700, + "sha": "f679ccfebbc736a35508ac4223934c516bd58e8b0352c3d753bdacede1a00243", + "type": "string" + } + }, + "to_columns:100": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "list" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "list" + } + }, + "to_columns:25000": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "list" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "list" + } + }, + "to_dataframe:25000": { + "lnk": { + "n": 700, + "sha": "1f8e38d20d1a9493da896e66199cee17d0b962282e326fdad8e95afef02c9e0e", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + }, + "rid": { + "n": 700, + "sha": "652142dd88194f47762252e1a8a555ff506d51b38a7e6a03e6f9622bbc04564d", + "type": "object" + }, + "rls": { + "n": 700, + "sha": "7d4004a951d1f59a5ab5672dd642faff52f05f0fd122df78106c190cc01d1e2d", + "type": "object" + } + }, + "to_polars:100": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "String" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "String" + }, + "rls": { + "n": 700, + "sha": "f679ccfebbc736a35508ac4223934c516bd58e8b0352c3d753bdacede1a00243", + "type": "String" + } + }, + "to_polars:25000": { + "lnk": { + "n": 700, + "sha": "08423a38c264dbd06aa40af9fe72fe8ce7d09819d19a0e1da82e9bd46fc6f4ea", + "type": "String" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + }, + "rid": { + "n": 700, + "sha": "73a8fd1aa66a4bb44be9f7dad7d376214ce7d8a005091bfa17eb3f99b2baf890", + "type": "String" + }, + "rls": { + "n": 700, + "sha": "f679ccfebbc736a35508ac4223934c516bd58e8b0352c3d753bdacede1a00243", + "type": "String" + } + } + }, + "g3": { + "to_arrow:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_arrow:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_columns:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_columns:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "list" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_dataframe:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "object" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_polars:100": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "List(Float64)" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "List(Int64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + }, + "to_polars:25000": { + "lfn": { + "n": 700, + "sha": "c17034d7929a2bbd7f2fcb55e3a7fa6111b649045e2a24197826b0821cc88888", + "type": "List(Float64)" + }, + "lin": { + "n": 700, + "sha": "96ce261876395c521cdf92e61f6cf924c5405d05133c67ae67fa09d74a52f555", + "type": "List(Int64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + } + }, + "g4": { + "to_arrow:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_arrow:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_columns:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_columns:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "list" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "ndarray:int64:()" + } + }, + "to_dataframe:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "object" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "int64" + } + }, + "to_polars:100": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "List(Float64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + }, + "to_polars:25000": { + "lfx": { + "n": 700, + "sha": "ff4803ce30b1ebd66982e8eb75a1f1d2b45b2e38fdeaecc12a534e4b75ab326e", + "type": "List(Float64)" + }, + "n": { + "n": 700, + "sha": "26ac5d80be9c2eae274b1bc3b422c3eedf1665fd2dd39e8a2d424b02d10d1f7d", + "type": "Int64" + } + } + }, + "rid_type": "arcadedb._native.codec.RID", + "version": "26.11.1.post3" + } +} diff --git a/tests/test_column_frames.py b/tests/test_column_frames.py index c5a6d13d..469d889f 100644 --- a/tests/test_column_frames.py +++ b/tests/test_column_frames.py @@ -741,3 +741,155 @@ def test_null_vectors_in_every_columnar_api(temp_db): assert p["v"].to_list()[3] == [1.5, 1.0, 2.0] m = db.query("sql", sql).to_columns()["v"] assert m.shape == (700, 3) and np.isnan(m[nulls]).all() + + +# --- the rid, li8 and lf8 kinds (refs #388): hand-built frames, no database + + +def _rids(pairs): + return b"".join(struct.pack("<2q", b, p) for b, p in pairs) + + +def _lists(rows, ctype): + """The buffer of a ``li8`` or ``lf8`` column: int32 offsets (n + 1), the bitmap of null elements, the flat int64 or float64 array. + A ``None`` row is an empty list (its null bit is the frame's).""" + offsets, flat, null_elements = [0], [], [] + for row in rows: + for e in row or []: + null_elements.append(len(flat) if e is None else None) + ( + flat.append(0 if ctype == "li8" else math.nan) + if e is None + else flat.append(e) + ) + offsets.append(len(flat)) + bitmap = bytearray((len(flat) + 7) // 8) + for j in (j for j in null_elements if j is not None): + bitmap[j >> 3] |= 1 << (j & 7) + fmt = "q" if ctype == "li8" else "d" + return ( + struct.pack(f"<{len(offsets)}i", *offsets) + + bytes(bitmap) + + struct.pack(f"<{len(flat)}{fmt}", *flat) + ) + + +INT_LISTS = [[1, 2, 3], [], None, [4, None], [2**62, -(2**62), 2**53 + 1], [None]] +FLOAT_LISTS = [ + [0.5, math.nan], + [math.inf, -math.inf, -0.0], + [], + None, + [0.1, None], + [5e-324], +] + + +def _null_rows(rows): + return [i for i, row in enumerate(rows) if row is None] + + +def test_rid_column_is_the_text_of_each_link_in_columns_and_arrow_with_nulls(): + pairs = [(12, 0), (12, 345), (0, 0), (3, 2**40), (0, 7)] + frame = _frame(5, [("r", "rid", [2], _rids(pairs))]) + texts = ["#12:0", "#12:345", None, "#3:1099511627776", "#0:7"] + _, parts = _columns(frame) + assert parts["r"] == texts + _, chunks = _arrow(frame) + assert chunks["r"].type == pa.string() + assert chunks["r"].to_pylist() == texts + + +def test_rid_column_hands_the_pairs_to_the_wheels_hook_and_nulls_stay_none(): + seen = [] + + def hook(pairs, side, col): + seen.append((pairs.tolist(), side, col["side"])) + return [("rid", b, p) for b, p in pairs.tolist()] + + frame = _frame(3, [("r", "rid", [1], _rids([(1, 2), (0, 0), (5, 6)]))]) + header, _ = _columnar.read_header(frame) + header["cols"][0][ + "side" + ] = 9 # what the bridge writes: where its RID objects start in the side array + cols = json.dumps(header).encode("utf-8") + frame = memoryview( + struct.pack("