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

Can't create function if too many parameters are specified #72

Closed
sfc-gh-gcharriere opened this issue Jan 31, 2023 · 4 comments
Closed
Labels

Comments

@sfc-gh-gcharriere
Copy link

Function creation fails if too many parameters are specified. This issue seems to be linked to a limited number of character supported in the IMPORTS statement of the UDF.

As you can see in the image, snowcli adds all the names and types specified as function parameter in the path where the application is zipped.
@ML_PROVIDER.APP.deployments/f_scoresf_string_rf_float_dd_float_pl_float_es_float_er_float_ec_number_ao_number_dblfd_number_dbfcd_number_fddf_number_fddm_number_fddsa_number_fddsu_number_fddth_number_fddtu_number_fddw_number_ca_number_cd_number_ch_number_cw_number/app.zip

Adding more input parameters adds more characters to the Import path. At some point, the function cannot be created.

Screenshot 2023-01-31 at 16 01 24

@jeffhollan
Copy link

Ah makes sense. Right now the logic creates a stage for each function and uses the input Params to name it (so myfunc(number, string) and myfunc(number) would have two stages). But this shows that limitation. I'll look at changing the logic to have some way to generate mostly unique stage names without hitting this character limit

@py-prash
Copy link

py-prash commented Jun 14, 2023

Related to this issue, the describe function (post create) fails for multiple input parameters. Its failing because the generate signature method (generate_signature_from_params(params: str) is not retrieving the data types correctly for the describe function. The split function in the method would need to be rewritten as something like below :
"(" + ",".join(" ".join(input_str.split(',')).split()[1::2])

@sfc-gh-kgaputis
Copy link

We could use a hash code appended to the function name to differentiate overloaded functions. And optionally that behavior could kick in when there are multiple arguments and the deployment name starts to approach the character limit.

@sfc-gh-astus
Copy link
Collaborator

Fixed in 2.0.0

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

6 participants