zjw1111 commented on code in PR #3457:
URL: https://github.com/apache/avro/pull/3457#discussion_r2328711235
##########
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:
@wgtmac @thiru-mg I split a zstd codec wrapper, could you please take a look
again? Thanks!
--
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]