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,
関連するコンテンツ
- 質問済み 9ヶ月前
- 質問済み 6ヶ月前
- AWS公式更新しました 3年前
- AWS公式更新しました 3年前
- AWS公式更新しました 2年前
so is it a best practice to run the imports within the function fo the custom transform?