Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested tuple: Support tuple as attribute type. #1679

Closed
ddebrunner opened this issue May 23, 2018 · 2 comments · Fixed by #2582
Closed

Nested tuple: Support tuple as attribute type. #1679

ddebrunner opened this issue May 23, 2018 · 2 comments · Fixed by #2582

Comments

@ddebrunner
Copy link
Member

Support nested tuples, e.g attribute b in this schema.

tuple<int32 a, tuple<int32 x, int32 y> b>

@ddebrunner ddebrunner changed the title Support tuple as attribute type. Support tuple as attribute type. Jun 6, 2018
@markheger markheger added the High label Apr 8, 2020
@markheger markheger changed the title Support tuple as attribute type. Nested tuple: Support tuple as attribute type. Apr 22, 2020
@markheger
Copy link
Member

  1. Required types:
  • str
  • bool
  • int
  • float
  • Decimal
  • complex
  • bytes
  • List[T]
  • Set[T]
  • Mapping[T]
  • Optional[T]
  1. Nesting of the above types, as well as custom types - for example:
class Address(NamedTuple):
    street: str
    city: str
    state: str
class Person(NamedTuple):
    name: str
    age: float
    address: Address
    children: List[Person]

@markheger
Copy link
Member

markheger commented Sep 15, 2020

This feature is related to conversion from structured stream to Python and vice versa.

For example streams from SPL operators containing nested tuples are converted to dict in the operator passing the tuple to Python callable.

Python callables can submit structured streams (with nested tuples), defined with type hints (named tuple), to downstream operators either Python operators or SPL operators.

Note

When a tuple on a structured stream, that contains nested tuples, is passed into a Python callable it is always converted to a dict object containing all attributes of the stream tuple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants