objectFileSourceStrategy extends Strategy with Logging
A strategy for planning scans over collections of files that might be partitioned or bucketed
by user specified columns.
At a high level planning occurs in several phases:
Split filters by when they need to be evaluated.
Prune the schema of the data requested based on any projections present. Today this pruning
is only done on top level columns, but formats should support pruning of nested columns as
well.
Construct a reader function by passing filters and the schema into the FileFormat.
Using a partition pruning predicates, enumerate the list of files that should be read.
Split the files into tasks and construct a FileScanRDD.
Add any projection or filters that must be evaluated after the scan.
Files are assigned into tasks using the following algorithm:
If the table is bucketed, group files by bucket id into the correct number of partitions.
If the table is not bucketed or bucketing is turned off:
If any file is larger than the threshold, split it into pieces based on that threshold
Sort the files by decreasing file size.
Assign the ordered files to buckets using the following algorithm. If the current partition
is under the threshold with the addition of the next file, add it. If not, open a new bucket
and add it. Proceed to the next file.
A strategy for planning scans over collections of files that might be partitioned or bucketed by user specified columns.
At a high level planning occurs in several phases:
Files are assigned into tasks using the following algorithm: