mirror of
https://github.com/apache/impala.git
synced 2026-01-30 15:00:18 -05:00
When trying to read from HDFS cache, ReadFromCache calls FileReader::Open(false) to force the file to open. The prior commit for IMPALA-11704 didn't allow for that case when using a data cache, as the data cache check would always happen. This resulted in a crash calling CachedFile as exclusive_hdfs_fh_ was nullptr. Tests only catch this when reading from HDFS cache with data cache enabled. Replaces explicit arguments to override FileReader behavior with a flag to communicate whether FileReader supports delayed open. Then the caller can choose whether to call Open before read. Also simplifies calls to ReadFromPos as it already has a pointer to ScanRange and can check whether file handle caching is enabled directly. The Open call in DoInternalRead uses a slightly wider net by only checking UseDataCache. If the data cache is unavailable or a miss the file will then be opened. Adds a select from tpch.nation to the query for test_data_cache.py as something that triggers checking the HDFS cache. Change-Id: I741488d6195e586917de220a39090895886a2dc5 Reviewed-on: http://gerrit.cloudera.org:8080/19228 Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
1.7 KiB
1.7 KiB