Packages

object FileSourceStrategy 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.
Linear Supertypes
SparkStrategy, GenericStrategy[SparkPlan], Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileSourceStrategy
  2. SparkStrategy
  3. GenericStrategy
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def apply(plan: LogicalPlan): Seq[SparkPlan]
    Definition Classes
    FileSourceStrategy → GenericStrategy