Open shlomi-dr opened 2 years ago
This PR is related to https://github.com/xitongsys/parquet-go/issues/395 and I'd suggest fix it like https://github.com/xitongsys/parquet-go/pull/407, which changes function signature to return (value, error)
instead value
only, this is a typical go way to my understanding. Once the function can return error, one can check pT
before dereference it, and return error to notify callers.
The preferred way may introduce large scale refactor though.
I was battling some nil dereference that was concealed deep in the library. I added a bunch of
debug.Stack()
calls to retain the original stacktrace, and found that in the following sectionpT
is some timesnil
:https://github.com/xitongsys/parquet-go/blob/5f74d27a1b816f8c28105c910526c1a94404a2e3/common/common.go#L667-L671
Not sure why that happens, see below comment for proposed fix