Skip to content

Conversation

@mihaibudiu
Copy link
Contributor

Fixes #5350

@mihaibudiu mihaibudiu requested review from Copilot and ryzhyk December 31, 2025 01:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #5350 by correcting the type handling of the connector_metadata variable from VARIANT to &VARIANT (a reference type). The change ensures proper type consistency when the CONNECTOR_METADATA() function is used in SQL table definitions.

Key changes:

  • Updated the return type transform for CONNECTOR_METADATA() from TO_NULLABLE to FORCE_NULLABLE
  • Changed the connector_metadata variable type to use a reference (&VARIANT) instead of a direct value
  • Modified expression handling to dereference and clone when replacing CONNECTOR_METADATA() calls

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CatalogTests.java Added regression test for issue #5350 validating VARIANT type handling with CONNECTOR_METADATA()
CustomFunctions.java Changed return type transform from TO_NULLABLE to FORCE_NULLABLE for CONNECTOR_METADATA function
ToRustInnerVisitor.java Updated variable type to reference (&VARIANT) and modified expression replacement to use deref().applyClone()

@mihaibudiu mihaibudiu added this pull request to the merge queue Dec 31, 2025
Merged via the queue into main with commit 287cc7c Dec 31, 2025
5 of 7 checks passed
@mihaibudiu mihaibudiu deleted the issue5350 branch December 31, 2025 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[compiler] ICE with CONNECTOR_METADATA()

3 participants