Skip to content

MERGE INTO statement produces misleading UNRESOLVED_COLUMN error when target table doesn't exist instead of TABLE_OR_VIEW_NOT_FOUND #14117

@vamshikrishnakyatham

Description

@vamshikrishnakyatham

Bug Description

What happened:

When executing a MERGE INTO statement with a non-existent target table, Spark threw a misleading UNRESOLVED_COLUMN error instead of a clear TABLE_OR_VIEW_NOT_FOUND error. The error message complained about columns not being found rather than indicating the table itself doesn't exist.

What you expected:

A clear and accurate error message stating that the target table does not exist

Steps to reproduce:

  1. Ensure a table named target_table does NOT exist in your database
  2. Create a source table: CREATE TABLE source_table (id INT, name STRING) USING hudi
  3. Execute a MERGE INTO statement:
   MERGE INTO target_table AS t
   USING source_table AS s
   ON t.id = s.id
   WHEN MATCHED THEN UPDATE SET name = s.name
   WHEN NOT MATCHED THEN INSERT *
  1. You'd see UNRESOLVED_COLUMN error which is not proper as target table itself is not present

Environment

Hudi version: 1.1.0
Query engine: (Spark/Flink/Trino etc)
Relevant configs:

Logs and Stack Trace

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugFor Issues and PRs that fix bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions