zjw1111 commented on code in PR #3457:
URL: https://github.com/apache/avro/pull/3457#discussion_r2303789822
##########
lang/c++/impl/DataFile.cc:
##########
@@ -491,22 +492,39 @@ void DataFileReaderBase::readDataBlock() {
if (decompressed_size == ZSTD_CONTENTSIZE_ERROR) {
throw Exception("ZSTD: Not a valid compressed frame");
} else if (decompressed_size == ZSTD_CONTENTSIZE_UNKNOWN) {
- throw Exception("ZSTD: Unable to determine decompressed size");
- }
-
- // Decompress the data
- uncompressed.clear();
- uncompressed.resize(decompressed_size);
- size_t result = ZSTD_decompress(
- uncompressed.data(), decompressed_size,
- reinterpret_cast<const char *>(compressed_.data()),
compressed_.size());
-
- if (ZSTD_isError(result)) {
- throw Exception("ZSTD decompression error: {}",
ZSTD_getErrorName(result));
- }
- if (result != decompressed_size) {
- throw Exception("ZSTD: Decompressed size mismatch: expected {},
got {}",
- decompressed_size, result);
+ // Stream decompress the data
+ ZSTD_DCtx *dctx = ZSTD_createDCtx();
Review Comment:
> @zjw1111 Do you have time to address this comment?
Sorry, I am a little busy this week, maybe I can address it next week.
(如果这里的address是翻译成“处理/设法解决”的话)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]