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

SNOW-912245: DatabaseMetaData.getProcedureParameters and getFunctionParameters are failing #1510

Closed
dbschema-pro opened this issue Sep 11, 2023 · 6 comments
Assignees
Labels

Comments

@dbschema-pro
Copy link

Calling this methods are slow or fails.
image002 (2)

@github-actions github-actions bot changed the title DatabaseMetaData.getProcedureParameters and getFunctionParameters are failing SNOW-912245: DatabaseMetaData.getProcedureParameters and getFunctionParameters are failing Sep 11, 2023
@sfc-gh-spanaite sfc-gh-spanaite self-assigned this Oct 3, 2023
@sfc-gh-spanaite sfc-gh-spanaite added the status-triage Issue is under initial triage label Oct 3, 2023
@sfc-gh-spanaite
Copy link
Contributor

@wise-coders Can you post a sample code rather than a screenshot so I can see what you are trying to do?

@dbschema-pro
Copy link
Author

This is for loading the schema structure in DbSchema, a database designer.
We found out that this happens for build-in functions and procedures.

it seems that built in function (is_buildin = ‚Y‘) could not use „desc function“

But the build-in functions are listed by SELECT GET_DDL ( 'SCHEMA', '<schema_name>', true)
and DatabaseMetaData.getFunctions() and getProcedures().
I think you should exclude the build-in procedures and functions from this methods.

@sfc-gh-spanaite
Copy link
Contributor

@wise-coders I am not sure I get it. For built-in functions you cannot use desc function <func_name> or select get_ddl and this is publicly documented (it only works for UDFs or external functions):

  • describe function:
    Describes the specified user-defined function (UDF) or external function, including the signature (i.e. arguments), return value, language, and body (i.e. definition).

  • get_ddl:
    FUNCTION (for UDFs, including external functions)

@dbschema-pro
Copy link
Author

We use select get_ddl only with the complete schema, and probably this does include the build in functions in the generated DDL.
Could you please double-check if this is true?

@sfc-gh-spanaite
Copy link
Contributor

That is not true, as I have done a quick test.

Let's say I use a specific database/schema of my own. If I do show functions I will see all functions including the OOB ones. Now for the same schema I do SELECT GET_DDL ( 'SCHEMA', '<schema_name>', true); and I see only my UDFs in the output, but not the OOB ones.

So, maybe you're using something else as well like show functions rather than only select get_ddl. That would explain it, but again as of now I see the behavior as the one documented.

@sfc-gh-spanaite sfc-gh-spanaite removed the status-triage Issue is under initial triage label Oct 26, 2023
@sfc-gh-spanaite
Copy link
Contributor

Any other feedback @wise-coders otherwise I will close this issue.

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

No branches or pull requests

2 participants