2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
Try importing specific function instead of import *. For example, "from pyspark.sql.functions import split" to import split function.
I tried replicating your problem, it complained that import * can only be used at module level. But when I changed to specific function, it worked.
Hope this help.
답변함 2년 전
0
Hi ,
yes, any library you need for your custom transform should be imported within the function.
just to consider if you want to run SparkSQL you could also use the SQL transform.
hope this helps,
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
so is it a best practice to run the imports within the function fo the custom transform?