Copilot commented on code in PR #12299:
URL: https://github.com/apache/gluten/pull/12299#discussion_r3432475777
##########
cpp/core/utils/tac/TypeAwareCompressCodec.cc:
##########
@@ -21,14 +21,18 @@
namespace gluten {
bool TypeAwareCompressCodec::support(int8_t tacType) {
- return tacType == tac::kUInt64;
+ return tacType == tac::kUInt64 || tacType == tac::kUInt128;
}
int64_t TypeAwareCompressCodec::maxCompressedLen(int64_t inputLen, int8_t
tacType) {
- if (!support(tacType)) {
- return 0;
+ switch (tacType) {
+ case tac::kUInt64:
+ return kPayloadHeaderSize + FForCodec::maxCompressedLength(inputLen);
+ case tac::kUInt128:
+ return kPayloadHeaderSize + FForCodec::maxCompressedLength128(inputLen);
+ default:
+ return 0;
}
Review Comment:
`maxCompressedLen()` returns a non-zero bound even when `inputLen` is 0
(while `compress()` returns 0 early), and for `kUInt64` it doesn't reject
non-8-byte-multiple lengths (it forwards to `FForCodec::maxCompressedLength()`,
which truncates). Tightening this keeps size estimation consistent with
compression preconditions and avoids avoidable over-allocation for empty
buffers.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]