EdwardShen125 opened a new pull request, #1702: URL: https://github.com/apache/arrow-go/pull/1702
### Rationale for this change From the note on #1647. `Close()` releases the dictionary buffer but leaves `cachedDict` valid, so `GetDictionaryPage()` on a closed reader returned a page with `nvals=2`, no data and no error. ### What changes are included in this PR? `Close()` now clears `cachedDict`, same as `Reset()`. A `GetDictionaryPage()` after `Close()` goes back to the stream and either returns the real dictionary page or fails. Calling it after `Close()` is still a misuse, it just doesn't return a wrong page anymore. ### Are these changes tested? Yes. `TestCloseInvalidatesCachedDictionary` reads the dictionary page, closes the reader and asks for it again. If a page comes back, its data has to be the dictionary. On main `Data()` is nil; with this change it is the 8 dictionary bytes. ```sh go test -short -count=1 ./parquet/... go test -race -count=1 ./parquet/file ./parquet/pqarrow cd parquet && golangci-lint run ./file/... ``` ### Are there any user-facing changes? No. AI-assisted, reviewed by a human. -- 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]
