如何为 spectrify python 包指定 s3 配置?
how to specify s3 config for spectrify python package?
如何为 python spectrify 包指定此 s3_config
对象?
from spectrify.export import RedshiftDataExporter
RedshiftDataExporter(sa_engine, s3_config).export_to_csv('my_table')
spectrify 包的文档不是很好,但可以快速阅读 the code and the examples will show you that s3_config can be an instance of S3Config or SimpleS3Config, both defined by the spectrify package. Here's an example:
csv_path_template = 's3://my-bucket/my-table/csv/{start.year}/{start.month:02d}/{start.day:02d}'
spectrum_path_template = 's3://my-bucket/my-table/spectrum/partition_key={start}'
# Construct a S3Config object with the source CSV folder and
# destination Spectrum/Parquet folder on S3.
csv_path = csv_path_template.format(start=start_date)
spectrum_path = spectrum_path_template.format(start=start_date)
s3_config = SimpleS3Config(csv_path, spectrum_path)
如何为 python spectrify 包指定此 s3_config
对象?
from spectrify.export import RedshiftDataExporter
RedshiftDataExporter(sa_engine, s3_config).export_to_csv('my_table')
spectrify 包的文档不是很好,但可以快速阅读 the code and the examples will show you that s3_config can be an instance of S3Config or SimpleS3Config, both defined by the spectrify package. Here's an example:
csv_path_template = 's3://my-bucket/my-table/csv/{start.year}/{start.month:02d}/{start.day:02d}'
spectrum_path_template = 's3://my-bucket/my-table/spectrum/partition_key={start}'
# Construct a S3Config object with the source CSV folder and
# destination Spectrum/Parquet folder on S3.
csv_path = csv_path_template.format(start=start_date)
spectrum_path = spectrum_path_template.format(start=start_date)
s3_config = SimpleS3Config(csv_path, spectrum_path)