[Python] Parquet 파일 형식으로 s3에 업로드

남영민·2021년 8월 3일
0
import pyarrow.parquet as pq
import s3fs
import pyarrow as pa

s3f = s3fs.S3FileSystem()
pd_table = pa.Table.from_pandas(data, preserve_index=False)
pq.write_to_dataset(
    pd_table,
    root_path="s3://service=alytics/type=log/result=conversion",
    filesystem=s3f,
    use_deprecated_int96_timestamps=True,
    compression='snappy',
    partition_cols=['year', 'month', 'day', 'hour'],
    use_dictionary=True,
)
profile
성장하는 개발자

1개의 댓글

comment-user-thumbnail
2024년 4월 6일

알 수 없는 구글 알고리즘에 들렸다 갑니다.

답글 달기

관련 채용 정보