Skip to content

CountStarDeltaTable Scala Extractor

CountStarDeltaTable is an extractor object (Scala) to extractGlobalCount for an Aggregate logical operator.

Matching Aggregate

  plan: Aggregate): Option[Long]

unapply extractGlobalCount for an Aggregate (Spark SQL) logical operator with the following:

Otherwise, unapply gives None (to indicate no match).

unapply is used when:


  tahoeLogFileIndex: TahoeLogFileIndex): Option[Long]

extractGlobalCount gets a DeltaScanGenerator for the given TahoeLogFileIndex.

extractGlobalCount requests the DeltaScanGenerator to filesWithStatsForScan (that gives a DataFrame) to execute the following aggregations on:

  • sum("stats.numRecords")
  • count(when(col("stats.numRecords").isNull, 1))