HuaHuaY commented on code in PR #48865:
URL: https://github.com/apache/arrow/pull/48865#discussion_r2705024963


##########
cpp/src/arrow/util/compression_zstd.cc:
##########
@@ -235,13 +226,47 @@ class ZSTDCodec : public Codec {
   int compression_level() const override { return compression_level_; }
 
  private:
+  Result<CCtxPtr> CreateCCtx() const {
+    CCtxPtr cctx{ZSTD_createCCtx(), ZSTD_freeCCtx};

Review Comment:
   I didn't see any relevant information in the Zstd documentation. But I found 
that there are some codes using `ZSTD_createCCtx()` and they check whether the 
return value is `nullptr`. So I added a judgment that returns an error if the 
result is `nullptr`.
   
   References:
   1. 
https://android.googlesource.com/platform/external/zstd/+/refs/heads/android14-mainline-adbd-release/examples/streaming_compression_thread_pool.c
   2. https://llvm.org/doxygen/Compression_8cpp_source.html



-- 
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]

Reply via email to