-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Description
Hi @laughingman7743,
I have the following model defined:
from sqlalchemy import Column, Float, Integer
from sqlalchemy.orm import declarative_base
from pyathena.sqlalchemy.types import AthenaArray, AthenaStruct, AthenaTimestamp
Base = declarative_base()
class DummyTable(Base):
__tablename__ = "dummy_table_athena"
id = Column(Integer, primary_key=True)
positions = Column(
"positions",
AthenaArray(
AthenaStruct(
("header", AthenaStruct(("stamp", AthenaTimestamp))), ("x", Float), ("y", Float)
)
),
)And if I access the database directly, I can see that the data has indeed the defined format (i.e., header={stamp=xyz, seq=ghi}, x=abc, y=def}). However, after executing a simple select:
query = (
athena_session.query(DummyTable.positions)
.where(DummyTable.id == <requested_id>)
)The value of the positions is something like:
[{'seq': 0, 'x': 4.736, 'y': 0.583}, {'seq': 0, 'x': 4.501, 'y': 1.023}, ...]
I.e., does not even reference the header{stamp} and has the seq at the same level as the other attributes.
Do you have any ideas of what may be causing this?
Best regards,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels