Skip to content

Add TypeCoercion optimizer rule #3221

Closed

Description

@andygrove

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
We currently do a lot of type coercion in the physical planning phase. I would like the ability to have type coercion and validation happen in the logical plan.

This would benefit projects such as Dask SQL that are using the SQL query planner.

Describe the solution you'd like
Add a new TypeCoercion rule that adds explicit CASTs where appropriate.

Describe alternatives you've considered
None

Additional context
None

Activity

  1. liukun4515 commented on Aug 24, 2022

    @liukun4515
    Contributor

    @andygrove
    I go through the spark code about the type coercion and find https://github.com/apache/spark/blob/55c3347c48f93a9c5c5c2fb00b30f838eb081b7f/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L323

    Spark has put the type coercion to the analysis phase, but DF don't have this phase.

  2. andygrove commented on Sep 7, 2022

    @andygrove
    MemberAuthor

    This was implemented in #3222

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions