Zouxxyy opened a new pull request, #13656: URL: https://github.com/apache/gluten/pull/13656
## What changes are proposed in this pull request? `JniReadFile::pread` constructs its returned `std::string_view` using the C-string constructor, which searches for a terminating NUL instead of using the requested read length. This truncates binary data at an embedded NUL and can read beyond the requested buffer range when the data is not NUL-terminated. Pass the requested length to the `std::string_view` constructor in both the Velox and Bolt implementations. For example, reading the four bytes `61 00 62 63` (`a\0bc`) previously returned a view of size 1. It now returns all four bytes. Add a shared native regression suite under `gluten-ut/native`, registered as `jni_file_system_test` for both backends. It exercises the actual registered JNI filesystem with a fake Java side that copies the requested bytes, covering embedded NULs, bytes beyond the requested length, and zero-length reads. ## How was this patch tested? - Compiled the current Velox JNI filesystem and Java exception sources with cached Velox/native dependencies and ran `JniFileSystemTest`: all 3 tests passed. All 3 regression cases failed before the fix. - C++ formatting with clang-format 15, CMake formatting, license headers, and `git diff --check` passed. - The shared suite is wired into the Bolt test target; the Bolt backend and a full backend rebuild were not run locally. ## Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-6) -- 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]
