Skip to content

feat: support cast StructType to String when duplicated column in the struct #2256

Description

@comphead

Describe the bug

The cast StructType to StringType fails on duplicated columns with auto and native_scan


          checkSparkAnswerAndOperator(
            "SELECT CAST(struct(_12, _12) as string) FROM tbl")

Expected only Comet native operators, but found Project.
plan: *(1) Project [cast(struct(_12, _12#11, _12, _12#11) as string) AS CAST(struct(_12, _12) AS STRING)#59]
+- *(1) CometColumnarToRow
   +- CometScan [native_iceberg_compat] parquet [_12#11] Batched: true, DataFilters: [], Format: CometParquet, Location: InMemoryFileIndex(1 paths)[file:/private/var/folders/6f/_s1vnnd55zgfkx7zlwnrnv0h0000gn/T/spark-76..., PartitionFilters: [], PushedFilters: [], ReadSchema: struct<_12:decimal(20,0)>

Found when working on #2175

Steps to reproduce

No response

Expected behavior

No response

Additional context

No response

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions