Open kokorin opened 5 months ago
Thanks for the proposal @kokorin! Happy to brainstorm on that one. Will simply changing the returns
to list be enough? I have a feeling we would need to consider something like
returns:
return_type: table
columns:
- name: "foo"
type: "string"
returns:
return_type: value
type: "string"
What do you think?
@sfc-gh-turbaszek to be honest return_type
is confusing especially in second case. May be it could be better to have another top-level list in snowflake.yml
:
definition_version: 1
snowpark:
functions:
- name: my_udf
# other props
returns: string
table_functions:
- name: my_udtf
# other props
returns:
- name: id
type: int
- name: name
type: string
procedures: [ ... ]
In that case it will be possible to validate signature.
Apart from that it can be useful to have more strict differentiation between UDF and UDTF:
definition_version: 1
snowpark:
functions:
- name: my_udf
# other props
returns: string
- name: my_udtf
# other props
returns_columns:
- name: id
type: int
- name: name
type: string
procedures: [ ... ]
Description
We are investigating usage of Snow CLI 2.1.0 in our project in which we have UDTF defined. Right now
returns
property of Snowflake Function definition hasstr
type. So we have to use a workaround definingreturns: "table (id int, name string)"
.I think it may be useful to allow name-type list to be specified the same way as for
signature
property:Context
No response