How to handle snappy files generated by Trino?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với bản tái hiện được cung cấp và traceback trong snappy/snappy_formats.py, đặc biệt là get_decompress_function và guess_format_by_header. So sánh hành vi giữa các phiên bản 0.7.0 và 0.7.1 bằng tệp do Trino tạo ra. Công việc được hoàn tất khi định dạng tệp được phát hiện và giải nén thành công mà không làm hồi quy đầu ra trước đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
With the new release to 0.7.1 the I can't decompress CSV files generated by Trino, I think the issue is related with the Hadoop_snappy. Does anyone know how it can fixed?
from snappy import snappy_formats
csv_file = 'csv_67dba65a.snappy'
def read_file(file_path):
return open(file_path, 'rb')
decompress_func, read_chunk = snappy_formats.get_decompress_function(
'auto',
read_file(csv_file)
)
decompressed_stream = io.BytesIO()
# Decompress the data
decompress_func(
read_file(csv_file),
decompressed_stream,
start_chunk=read_chunk
)
decompressed_stream.seek(0)
print(f"Compressed file: {read_file(csv_file).read()}")
print(f"DeCompressed file: {decompressed_stream.read()}")
This code has different outputs based on the version:
-
0.7.0
Compressed file: b'\x00\x00\x00\x04\x00\x00\x00\x06\x04\x0c"a"\n'
DeCompressed file: b'"a"\n"a"\n' -
0.7.1
.venv/lib/python3.12/site-packages/snappy/snappy_formats.py", line 64, in get_decompress_function
decompress_func, read_chunk = guess_format_by_header(fin)
.venv/lib/python3.12/site-packages/snappy/snappy_formats.py", line 59, in guess_format_by_header
raise UncompressError("Can't detect archive format")
snappy.snappy.UncompressError: Can't detect archive format
- Ngôn ngữ chính
- Python
- Star
- 490
- Fork
- 104
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của intake/python-snappy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
intake/python-snappy#152 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
intake/python-snappy#151 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
intake/python-snappy#150 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
intake/python-snappy#147 · 3 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
intake/python-snappy#138 · 2 bình luận ·