trait PrepareDeltaScanBase extends Rule[LogicalPlan] with PredicateHelper with DeltaLogging with OptimizeMetadataOnlyDeltaQuery with SubqueryTransformerHelper

Before query planning, we prepare any scans over delta tables by pushing any projections or filters in allowing us to gather more accurate statistics for CBO and metering.

Note the following - This rule also ensures that all reads from the same delta log use the same snapshot of log thus providing snapshot isolation. - If this rule is invoked within an active OptimisticTransaction, then the scans are generated using the transaction.

Self Type
PrepareDeltaScan
Linear Supertypes
SubqueryTransformerHelper, OptimizeMetadataOnlyDeltaQuery, DeltaLogging, DatabricksLogging, DeltaProgressReporter, PredicateHelper, AliasHelper, Rule[LogicalPlan], Logging, SQLConfHelper, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PrepareDeltaScanBase
  2. SubqueryTransformerHelper
  3. OptimizeMetadataOnlyDeltaQuery
  4. DeltaLogging
  5. DatabricksLogging
  6. DeltaProgressReporter
  7. PredicateHelper
  8. AliasHelper
  9. Rule
  10. Logging
  11. SQLConfHelper
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class DeltaColumnStat(min: Any, max: Any) extends Product with Serializable

    Min and max values from Delta Log stats or partitionValues.

    Min and max values from Delta Log stats or partitionValues.

    Definition Classes
    OptimizeMetadataOnlyDeltaQuery
  2. abstract class DeltaTableScan[FileIndexType <: FileIndex] extends AnyRef

Value Members

  1. object MetadataOptimizableAggregate
  2. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def apply(_plan: LogicalPlan): LogicalPlan
    Definition Classes
    PrepareDeltaScanBase → Rule
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def buildBalancedPredicate(expressions: Seq[Expression], op: (Expression, Expression) ⇒ Expression): Expression
    Attributes
    protected
    Definition Classes
    PredicateHelper
  8. def canEvaluate(expr: Expression, plan: LogicalPlan): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  9. def canEvaluateWithinJoin(expr: Expression): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. def conf: SQLConf
    Definition Classes
    SQLConfHelper
  12. def deltaAssert(check: ⇒ Boolean, name: String, msg: String, deltaLog: DeltaLog = null, data: AnyRef = null, path: Option[Path] = None): Unit

    Helper method to check invariants in Delta code.

    Helper method to check invariants in Delta code. Fails when running in tests, records a delta assertion event and logs a warning otherwise.

    Attributes
    protected
    Definition Classes
    DeltaLogging
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def extractPredicatesWithinOutputSet(condition: Expression, outputSet: AttributeSet): Option[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  16. def filesForScan(scanGenerator: DeltaScanGenerator, limitOpt: Option[Int], filters: Seq[Expression], delta: LogicalRelation): DeltaScan

    Scan files using the given filters and return DeltaScan.

    Scan files using the given filters and return DeltaScan.

    Note: when limitOpt is non empty, filters must contain only partition filters. Otherwise, it can contain arbitrary filters. See DeltaTableScan for more details.

    Attributes
    protected
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def findExpressionAndTrackLineageDown(exp: Expression, plan: LogicalPlan): Option[(Expression, LogicalPlan)]
    Definition Classes
    PredicateHelper
  19. def getAliasMap(exprs: Seq[NamedExpression]): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  20. def getAliasMap(plan: Aggregate): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  21. def getAliasMap(plan: Project): AttributeMap[Alias]
    Attributes
    protected
    Definition Classes
    AliasHelper
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def getCommonTags(deltaLog: DeltaLog, tahoeId: String): Map[TagDefinition, String]
    Definition Classes
    DeltaLogging
  24. def getDeltaScanGenerator(index: TahoeLogFileIndex): DeltaScanGenerator

    Gets the DeltaScanGenerator for the given log, which will be used to generate DeltaScans.

    Gets the DeltaScanGenerator for the given log, which will be used to generate DeltaScans. Every time this method is called on a log within the lifetime of this rule (i.e., the lifetime of the query for which this rule was instantiated), the returned generator will read a snapshot that is pinned on the first access for that log.

    Internally, it will use the snapshot of the file index, the snapshot of the active transaction (if any), or the latest snapshot of the given log.

    Attributes
    protected
    Definition Classes
    PrepareDeltaScanBaseOptimizeMetadataOnlyDeltaQuery
  25. def getErrorData(e: Throwable): Map[String, Any]
    Definition Classes
    DeltaLogging
  26. def getPreparedIndex(preparedScan: DeltaScan, fileIndex: TahoeLogFileIndex): PreparedDeltaFileIndex

    Helper method to generate a PreparedDeltaFileIndex

    Helper method to generate a PreparedDeltaFileIndex

    Attributes
    protected
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  29. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def isLikelySelective(e: Expression): Boolean
    Definition Classes
    PredicateHelper
  32. def isNullIntolerant(expr: Expression): Boolean
    Attributes
    protected
    Definition Classes
    PredicateHelper
  33. def isSubqueryRoot(plan: LogicalPlan): Boolean

    Is the give plan a subquery root.

    Is the give plan a subquery root.

    Definition Classes
    SubqueryTransformerHelper
  34. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  35. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  36. def logConsole(line: String): Unit
    Definition Classes
    DatabricksLogging
  37. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  42. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  44. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  46. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  47. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  48. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  49. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  51. def optimizeGeneratedColumns(scan: LogicalPlan, preparedIndex: PreparedDeltaFileIndex, filters: Seq[Expression], limit: Option[Int], delta: LogicalRelation): LogicalPlan
    Attributes
    protected
  52. def optimizeQueryWithMetadata(plan: LogicalPlan): LogicalPlan
  53. def outputWithNullability(output: Seq[Attribute], nonNullAttrExprIds: Seq[ExprId]): Seq[Attribute]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  54. def prepareDeltaScan(plan: LogicalPlan): LogicalPlan

    Prepares delta scans sequentially.

    Prepares delta scans sequentially.

    Attributes
    protected
  55. def prepareDeltaScanWithoutFileSkipping(plan: LogicalPlan): LogicalPlan
    Attributes
    protected
  56. def recordDeltaEvent(deltaLog: DeltaLog, opType: String, tags: Map[TagDefinition, String] = Map.empty, data: AnyRef = null, path: Option[Path] = None): Unit

    Used to record the occurrence of a single event or report detailed, operation specific statistics.

    Used to record the occurrence of a single event or report detailed, operation specific statistics.

    path

    Used to log the path of the delta table when deltaLog is null.

    Attributes
    protected
    Definition Classes
    DeltaLogging
  57. def recordDeltaOperation[A](deltaLog: DeltaLog, opType: String, tags: Map[TagDefinition, String] = Map.empty)(thunk: ⇒ A): A

    Used to report the duration as well as the success or failure of an operation on a deltaLog.

    Used to report the duration as well as the success or failure of an operation on a deltaLog.

    Attributes
    protected
    Definition Classes
    DeltaLogging
  58. def recordDeltaOperationForTablePath[A](tablePath: String, opType: String, tags: Map[TagDefinition, String] = Map.empty)(thunk: ⇒ A): A

    Used to report the duration as well as the success or failure of an operation on a tahoePath.

    Used to report the duration as well as the success or failure of an operation on a tahoePath.

    Attributes
    protected
    Definition Classes
    DeltaLogging
  59. def recordEvent(metric: MetricDefinition, additionalTags: Map[TagDefinition, String] = Map.empty, blob: String = null, trimBlob: Boolean = true): Unit
    Definition Classes
    DatabricksLogging
  60. def recordFrameProfile[T](group: String, name: String)(thunk: ⇒ T): T
    Attributes
    protected
    Definition Classes
    DeltaLogging
  61. def recordOperation[S](opType: OpType, opTarget: String = null, extraTags: Map[TagDefinition, String], isSynchronous: Boolean = true, alwaysRecordStats: Boolean = false, allowAuthTags: Boolean = false, killJvmIfStuck: Boolean = false, outputMetric: MetricDefinition = METRIC_OPERATION_DURATION, silent: Boolean = true)(thunk: ⇒ S): S
    Definition Classes
    DatabricksLogging
  62. def recordProductEvent(metric: MetricDefinition with CentralizableMetric, additionalTags: Map[TagDefinition, String] = Map.empty, blob: String = null, trimBlob: Boolean = true): Unit
    Definition Classes
    DatabricksLogging
  63. def recordProductUsage(metric: MetricDefinition with CentralizableMetric, quantity: Double, additionalTags: Map[TagDefinition, String] = Map.empty, blob: String = null, forceSample: Boolean = false, trimBlob: Boolean = true, silent: Boolean = false): Unit
    Definition Classes
    DatabricksLogging
  64. def recordUsage(metric: MetricDefinition, quantity: Double, additionalTags: Map[TagDefinition, String] = Map.empty, blob: String = null, forceSample: Boolean = false, trimBlob: Boolean = true, silent: Boolean = false): Unit
    Definition Classes
    DatabricksLogging
  65. def replaceAlias(expr: Expression, aliasMap: AttributeMap[Alias]): Expression
    Attributes
    protected
    Definition Classes
    AliasHelper
  66. def replaceAliasButKeepName(expr: NamedExpression, aliasMap: AttributeMap[Alias]): NamedExpression
    Attributes
    protected
    Definition Classes
    AliasHelper
  67. lazy val ruleId: RuleId
    Attributes
    protected
    Definition Classes
    Rule
  68. val ruleName: String
    Definition Classes
    Rule
  69. def splitConjunctivePredicates(condition: Expression): Seq[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  70. def splitDisjunctivePredicates(condition: Expression): Seq[Expression]
    Attributes
    protected
    Definition Classes
    PredicateHelper
  71. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  72. def toString(): String
    Definition Classes
    AnyRef → Any
  73. def transformWithSubqueries(plan: LogicalPlan)(rule: PartialFunction[LogicalPlan, LogicalPlan]): LogicalPlan

    Transform all nodes matched by the rule in the query plan rooted at given plan.

    Transform all nodes matched by the rule in the query plan rooted at given plan. It traverses the tree starting from the leaves, whenever a SubqueryExpression expression is encountered, given rule is applied to the subquery plan plan in SubqueryExpression starting from the plan root until leaves.

    This is slightly different behavior compared to QueryPlan.transformUpWithSubqueries or QueryPlan.transformDownWithSubqueries

    It requires that the given plan already gone through OptimizeSubqueries and the root node denoting a subquery is removed and optimized appropriately.

    Definition Classes
    SubqueryTransformerHelper
  74. def trimAliases(e: Expression): Expression
    Attributes
    protected
    Definition Classes
    AliasHelper
  75. def trimNonTopLevelAliases[T <: Expression](e: T): T
    Attributes
    protected
    Definition Classes
    AliasHelper
  76. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  79. def withStatusCode[T](statusCode: String, defaultMessage: String, data: Map[String, Any] = Map.empty)(body: ⇒ T): T

    Report a log to indicate some command is running.

    Report a log to indicate some command is running.

    Definition Classes
    DeltaProgressReporter
  80. object DeltaTableScan extends PrepareDeltaScan.DeltaTableScan[TahoeLogFileIndex]

    This is an extractor object.

    This is an extractor object. See https://docs.scala-lang.org/tour/extractor-objects.html.

Inherited from SubqueryTransformerHelper

Inherited from DeltaLogging

Inherited from DatabricksLogging

Inherited from DeltaProgressReporter

Inherited from PredicateHelper

Inherited from AliasHelper

Inherited from Rule[LogicalPlan]

Inherited from Logging

Inherited from SQLConfHelper

Inherited from AnyRef

Inherited from Any

Ungrouped