wgtmac commented on issue #41431:
URL: https://github.com/apache/arrow/issues/41431#issuecomment-2096324100

   I have found the root cause.
   
   1. When the dataset scanner is running for the 1st time, it will cache 
`FileMetaData` in the ParquetFileFragment: 
https://github.com/apache/arrow/blob/d10ebf055a393c94a693097db1dca08ff86745bd/cpp/src/arrow/dataset/file_parquet.cc#L816
   2. When the dataset creates a new scanner, the internal parquet reader will 
reuse the cached `FileMetaData` instead of parsing it from the footer: 
https://github.com/apache/arrow/blob/d10ebf055a393c94a693097db1dca08ff86745bd/cpp/src/parquet/file_reader.cc#L779
   3. Because we don't parse FileMetaData again, `file_decryptor_` is not 
created any more. It was created in the 1st run here: 
https://github.com/apache/arrow/blob/d10ebf055a393c94a693097db1dca08ff86745bd/cpp/src/parquet/file_reader.cc#L686


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