Skip to content

Add CAST to parser.py #198

@jayceslesar

Description

@jayceslesar

Feature Request / Improvement

I think I have somewhat of an idea on how to do this, so far have added the following to parser.py:

CAST = CaselessKeyword("cast")
cast_expression = (CAST + "(" + column + "as" + identifier + Suppress(")")).set_results_name("cast")

# would need something special for the set_parse_action

I am wondering a couple of things:
Do we need a new class CastableReference or something? Worth expanding on the Reference class? And once that is done, how would we propagate the new type (Im assuming we need some way to go from a string to an IcebergType of the string the user has put into the cast operation) into the scan?

This was spawned from #170

Happy to work on this, just would be awesome to get some context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions