我已经通过数据连接将一个包含 100,000 个大约 100GB 的原始 json 文件的数据集导入到代工厂中。我想使用Python Transforms raw file access转换来读取文件,将结构和结构的数组展平到数据帧中,作为对 df 的增量更新。我想使用来自 *.json 文件的文档中的以下示例中的内容,并将其转换为使用@incremental()装饰器更新的增量。
>>> import csv
>>> from pyspark.sql import Row
>>> from transforms.api import transform, Input, Output
>>>
>>> @transform(
... processed=Output('/examples/hair_eye_color_processed'),
... hair_eye_color=Input('/examples/students_hair_eye_color_csv'),
... )
... def example_computation(hair_eye_color, processed):
...
... def process_file(file_status):
... with hair_eye_color.filesystem().open(file_status.path) as f:
... r = csv.reader(f)
...
... # Construct a pyspark.Row from our header row
... header = next(r)
... MyRow = Row(*header)
...
... …Run Code Online (Sandbox Code Playgroud) pyspark palantir-foundry foundry-code-repositories foundry-code-workbooks
在现有代码工作簿中使用“导出到代码存储库助手”工具时,修改下游依赖项以指向新创建的代码存储库数据集的最有效方法是什么?
我们想要修改所有下游依赖项,而不是子集。
palantir-foundry foundry-code-repositories foundry-code-workbooks
我需要在 Palantir Foundry 的代码工作簿中合并两个数据集,但我不知道该怎么做。我想使用 Pyspark 来做到这一点。我是Foundry新手,请帮忙!
python union pyspark palantir-foundry foundry-code-workbooks
我正在尝试构建工作,但其中一个阶段间歇性失败,并出现以下错误:
Could not execute broadcast in 300 secs. You can increase the timeout for broadcasts via spark.sql.broadcastTimeout or disable broadcast join by setting spark.sql.autoBroadcastJoinThreshold to -1
Run Code Online (Sandbox Code Playgroud)
我应该如何处理这个错误?