Skip to content

[BUG] Explicit makeNullLiteral fails the schema merge for append and multisearch commands #4493

@songkant-aws

Description

@songkant-aws

What is the bug?
Both append and multisearch commands currently unions two search results by merging schema if the two search row types are different. The non existent fields in search A output, which comes from another search B, will be filled out with NULL literal by calling makeNullLiteral method to cast the NULL literal to the same type in merge schema.

Calcite RexBuilder makeNullLiteral internally calls makeCast method. PPL ExtendedRexBuilder can't handle cast UDT type to NULL literal.

How can one reproduce the bug?

// Append with birthdate UDT_TIMESTAMP:
source=account | fields account_name, age | head 2 |
append [ source=bank | fields account_name, age, birthdate | head 2 ]

// Multisearch with birthdate UDT_TIMESTAMP
| multisearch 
     [search source=account | fields age] 
     [search source=bank | fields age, birthdate] 

What is the expected behavior?
Query should not fail.

What is your host/environment?

  • OS: All
  • Version [3.3]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions