pyspiral 0.6.10__cp312-abi3-macosx_11_0_arm64.whl → 0.6.12__cp312-abi3-macosx_11_0_arm64.whl
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.
Potentially problematic release.
This version of pyspiral might be problematic. Click here for more details.
- {pyspiral-0.6.10.dist-info → pyspiral-0.6.12.dist-info}/METADATA +1 -1
- {pyspiral-0.6.10.dist-info → pyspiral-0.6.12.dist-info}/RECORD +31 -27
- spiral/_lib.abi3.so +0 -0
- spiral/cli/key_spaces.py +1 -1
- spiral/cli/tables.py +3 -3
- spiral/client.py +20 -12
- spiral/core/client/__init__.pyi +8 -8
- spiral/core/expr/__init__.pyi +15 -0
- spiral/core/expr/images/__init__.pyi +3 -0
- spiral/core/expr/list_/__init__.pyi +4 -0
- spiral/core/expr/refs/__init__.pyi +4 -0
- spiral/core/expr/str_/__init__.pyi +3 -0
- spiral/core/expr/struct_/__init__.pyi +6 -0
- spiral/core/expr/text/__init__.pyi +5 -0
- spiral/core/expr/udf/__init__.pyi +14 -0
- spiral/core/expr/video/__init__.pyi +3 -0
- spiral/core/table/__init__.pyi +10 -1
- spiral/core/table/spec/__init__.pyi +4 -0
- spiral/dataloader.py +46 -37
- spiral/expressions/__init__.py +13 -20
- spiral/expressions/base.py +9 -4
- spiral/expressions/s3.py +18 -0
- spiral/expressions/tiff.py +2 -3
- spiral/expressions/udf.py +34 -25
- spiral/project.py +6 -6
- spiral/scan.py +28 -0
- spiral/streaming_/stream.py +1 -1
- spiral/table.py +25 -5
- spiral/transaction.py +27 -0
- spiral/expressions/http.py +0 -86
- spiral/expressions/io.py +0 -100
- spiral/expressions/mp4.py +0 -62
- spiral/expressions/png.py +0 -18
- spiral/expressions/qoi.py +0 -18
- spiral/expressions/refs.py +0 -58
- {pyspiral-0.6.10.dist-info → pyspiral-0.6.12.dist-info}/WHEEL +0 -0
- {pyspiral-0.6.10.dist-info → pyspiral-0.6.12.dist-info}/entry_points.txt +0 -0
spiral/expressions/refs.py
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import pyarrow as pa
|
|
2
|
-
|
|
3
|
-
from spiral.expressions.base import Expr, ExprLike
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def ref(expr: ExprLike, field: str | None = None) -> Expr:
|
|
7
|
-
"""Store binary values as references. This expression can only be used on write.
|
|
8
|
-
|
|
9
|
-
It is often better to store large cell values, such as bytes columns, that aren't used in filter expressions as
|
|
10
|
-
references. This enables more efficient scan pruning. Many of the Spiral's cell pushdown expressions work
|
|
11
|
-
over references.
|
|
12
|
-
|
|
13
|
-
Args:
|
|
14
|
-
expr: The expression to store as a reference.
|
|
15
|
-
field: If the expr evaluates into struct, the field name of that struct that should be referenced.
|
|
16
|
-
If `None`, the expr must evaluate into a type that supports referencing.
|
|
17
|
-
"""
|
|
18
|
-
from spiral import _lib
|
|
19
|
-
from spiral.expressions import lift
|
|
20
|
-
|
|
21
|
-
expr = lift(expr)
|
|
22
|
-
return Expr(_lib.expr.refs.ref(expr.__expr__, field))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def deref(expr: ExprLike | str, field: str | None = None) -> Expr:
|
|
26
|
-
"""De-reference referenced values.
|
|
27
|
-
|
|
28
|
-
See `ref` for more information on Spiral's reference values. This expression is used to de-reference referenced
|
|
29
|
-
column back into their original form, e.g. binary.
|
|
30
|
-
|
|
31
|
-
Args:
|
|
32
|
-
expr: The expression to de-reference. A str is assumed to be the `se.aux` expression.
|
|
33
|
-
field: If the expr evaluates into struct, the field name of that struct that should be de-referenced.
|
|
34
|
-
If `None`, the expr must evaluate into a reference type.
|
|
35
|
-
"""
|
|
36
|
-
from spiral import _lib
|
|
37
|
-
from spiral.expressions import aux, lift
|
|
38
|
-
|
|
39
|
-
if isinstance(expr, str):
|
|
40
|
-
expr = aux(
|
|
41
|
-
expr,
|
|
42
|
-
pa.struct([("__ref__", pa.struct([("id", pa.string()), ("begin", pa.uint64()), ("end", pa.uint64())]))]),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
expr = lift(expr)
|
|
46
|
-
return Expr(_lib.expr.refs.deref(expr.__expr__, field=field))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def nbytes(expr: ExprLike) -> Expr:
|
|
50
|
-
"""Return the number of bytes in a reference.
|
|
51
|
-
|
|
52
|
-
Args:
|
|
53
|
-
expr: The ref expression to get the number of bytes from.
|
|
54
|
-
"""
|
|
55
|
-
from spiral.expressions import lift
|
|
56
|
-
|
|
57
|
-
expr = lift(expr)
|
|
58
|
-
return expr["__ref__"]["end"] - expr["__ref__"]["begin"]
|
|
File without changes
|
|
File without changes
|