Skip to content

Conversation

@TCeason
Copy link
Collaborator

@TCeason TCeason commented Dec 9, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Call-procedure binding now tries an exact signature match, then enumerates same-name overloads; if only one exists, it verifies implicit casts inline and injects them, otherwise it demands explicit casts to avoid ambiguity.
  • Added an internal helper to parse stored procedure signatures and judge compatibility so the binder stays concise while still handling nullable/subquery quirks.

Example

statement ok
CREATE OR REPLACE PROCEDURE test_cast_int64(x INT64) RETURNS INT64 NOT NULL LANGUAGE SQL AS $$
BEGIN
    RETURN x + 100;
END;
$$;

query T
call procedure test_cast_int64(1);
----
101

Note:

Overloads still require explicit guidance when they would otherwise be ambiguous—e.g. definitions p1(string) and p1(date) make CALL p1('2024-03-03') fail until the caller casts to ::DATE or ::STRING, because the engine can’t infer
which interpretation the literal should take.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@TCeason TCeason marked this pull request as draft December 9, 2025 11:35
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Dec 9, 2025
@TCeason TCeason marked this pull request as ready for review December 10, 2025 01:25
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@TCeason
Copy link
Collaborator Author

TCeason commented Dec 10, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@BohuTANG BohuTANG merged commit f9c16aa into databendlabs:main Dec 10, 2025
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants