Skip to content

Top-level map columns reflect as String #857

Description

@aminghadersohi

Problem

AthenaDialect._get_column_type now reflects array<...> and nested map/struct types, but a top-level map<string,int> column still reflects as String, so the key and value types are lost for inspectors and autoload_with tables.

Reproduction

from pyathena.sqlalchemy.base import AthenaDialect
AthenaDialect()._get_column_type('map<string,int>')   # String()
AthenaDialect()._get_column_type('array<map<string,int>>').item_type  # AthenaMap(...)

Environment

PyAthena 3.35.4 and master (c01c56f), Python 3.11, SQLAlchemy 2.0.52, Athena engine version 3.

Proposed fix (optional)

Apply the nested map branch at the top level too, returning AthenaMap(key_type, value_type).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions