@udf(name='a_plus_b', input_types=[IntegerType(), IntegerType()], return_type=IntegerType(), is_permanent=False, 替换=True) def a_plus_b(a: int, b: int) -> int: 返回a+b
def main(会话:snowpark.Session):
df.with_column('Somme',a_plus_b( col('a'),col('b') ) )
return df
这是我的@udf 注册中的错误。
回溯(最近一次调用最后一次):工作表,第 8 行,在
有人可以帮我吗。
def main(会话:snowpark.Session):
@udf(name='a_plus_b', input_types=[IntegerType(), IntegerType()], return_type=IntegerType(), is_permanent=False, replace=True)
def a_plus_b(a: int, b: int) -> int: return a+b
df.with_column('Somme',a_plus_b( col('a'),col('b') ) )
返回df