Source code for xpark.dataset.namespace_expressions.struct_namespace

"""Struct namespace for expression operations on struct-typed columns."""

from __future__ import annotations

from dataclasses import dataclass

from ray.data.namespace_expressions.struct_namespace import _StructNamespace as RayStructNamespace


[docs] @dataclass class _StructNamespace(RayStructNamespace): """Namespace for struct operations on expression columns. This namespace provides methods for operating on struct-typed columns using PyArrow compute functions. Example: >>> from xpark.dataset.expressions import col >>> # Access a field using method >>> expr = col("user_record").struct.field("age") >>> # Access a field using bracket notation >>> expr = col("user_record").struct["age"] >>> # Access nested field >>> expr = col("user_record").struct["address"].struct["city"] """