Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better hint display for sql udf creation #14853

Closed
xzhseh opened this issue Jan 29, 2024 · 1 comment · Fixed by #15091
Closed

Better hint display for sql udf creation #14853

xzhseh opened this issue Jan 29, 2024 · 1 comment · Fixed by #15091
Assignees
Milestone

Comments

@xzhseh
Copy link
Contributor

xzhseh commented Jan 29, 2024

PostgresSQL has a fairly readable and precise hint if any invalid parameter is used during sql udf's definition time, as shown below.

create function better_hint(INT, a INT, INT) returns varchar language sql as $$select $1 + aa + $3$$;
ERROR:  column "aa" does not exist
LINE 1: ...NT) returns varchar language sql as $$select $1 + aa + $3$$;
                                                             ^

Our current sql udf implementation does have some hint on the missing item, but the overall error message looks large and heavy, which is also not readable and precise as postgres's, as follows.

create function better_hint(INT, a INT, INT) returns varchar language sql as $$select $1 + aa + $3$$;
ERROR:  Failed to run the query

Caused by:
  Invalid input syntax: failed to conduct semantic check, please see if you are calling non-existence functions: Failed to bind expression: $1 + aa + $3: Item not found: Invalid column: aa

Thus, it's better that we could have a better hint display especially when an error happens during sql udf's definition time, to help users better understand what's happening under the hood.

@BugenZhao
Copy link
Member

There has been a similar discussion before on this topic: #14322 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants