Skip to content

Standardize the separator in name #10364

Open

Description

@jayzhan211

Is your feature request related to a problem or challenge?

While working on replacing GetFieldAccess with get_field function, I got the name checking error that due to the mismatch of separator in creating name. I found that most of the name built with single comma and space, so I think we should switch others to this format .join(", ").

Error is like

External error: query failed: DataFusion error: Internal error: Input field name SUM(get_field(CASE WHEN get_field(t2.struct(t1.time,t1.load1,t1.load2,t1.host), Utf8("c3")) IS NOT NULL THEN t2.struct(t1.time,t1.load1,t1.load2,t1.host) END,Utf8("c2"))) does not match with the projection expression SUM(get_field(CASE WHEN get_field(t2.struct(t1.time,t1.load1,t1.load2,t1.host),Utf8("c3")) IS NOT NULL THEN t2.struct(t1.time,t1.load1,t1.load2,t1.host) END,Utf8("c2"))).
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
[SQL] select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c2']) from (select struct(time,load1,load2,host) from t1) t2 where t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host;

I got one with t2.struct(t1.time,t1.load1,t1.load2,t1.host), Utf8("c3") and another t2.struct(t1.time,t1.load1,t1.load2,t1.host),Utf8("c3"). That is why I think we should fix the separator.

Since the change is quite large, I would like to wait for more comment.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

You can find the error here with cargo test --test sqllogictests -- expr. Although, it is not on the main branch, but I think most of the changes are unrelated to the name checking issue.

Activity

  1. alamb commented on May 3, 2024

    @alamb
    Contributor

    I agree this makes sense. Thank you

  2. joroKr21 commented on Aug 14, 2024

    @joroKr21
    Contributor

    Also why do we have all of these which are slightly different? It's really unmanageable:

    • Expr::schema_name
    • Expr::canonical_name
    • physical_name
  3. jayzhan211 commented on Aug 14, 2024

    @jayzhan211
    ContributorAuthor

    Also why do we have all of these which are slightly different? It's really unmanageable:

    • Expr::schema_name
    • Expr::canonical_name
    • physical_name

    schema_name is used in Schema.
    canonical_name, I'm not sure. It seems we could remove this as well
    physical_name, I think we might need another schema name for Physical Expr

    I'm working on this naming issue #11782

  4. joroKr21 commented on Aug 14, 2024

    @joroKr21
    Contributor

    Maybe we can just use the schema_name for physical_name? It sounds like a bug if they are different: #11977

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