关注 spark技术分享,
撸spark源码 玩spark最佳实践

InMemoryRelation

InMemoryRelation Leaf Logical Operator For Cached Physical Query Plans

InMemoryRelation is a leaf logical operator that represents a cached child physical query plan.

InMemoryRelation is created when:

InMemoryRelation is a MultiInstanceRelation so a new instance will be created to appear multiple times in a physical query plan.

Note

InMemoryRelation is created using apply factory method that accepts no output attributes and so uses the output of the child physical plan instead.

Table 1. InMemoryRelation’s Internal Properties (e.g. Registries, Counters and Flags)
Name Description

partitionStatistics

PartitionStatistics for the output schema

Used exclusively when InMemoryTableScanExec is created (and initializes stats internal property).

Computing Statistics — computeStats Method

Note
computeStats is part of LeafNode Contract to compute statistics for cost-based optimizer.

computeStats…​FIXME

Creating InMemoryRelation Instance

InMemoryRelation takes the following when created:

  • Output schema attributes

  • useCompression flag

  • Batch size

  • Storage level

  • Child physical query plan

  • Table name (if used)

  • Cached column buffers (as RDD[CachedBatch])

  • Size in bytes statistic (as LongAccumulator)

  • Statistics of the child query plan

withOutput Method

withOutput…​FIXME

Note
withOutput is used exclusively when CacheManager is requested to replace logical query segments with cached query plans.

newInstance Method

Note
newInstance is part of MultiInstanceRelation Contract to…​FIXME.

newInstance…​FIXME

cachedColumnBuffers Method

cachedColumnBuffers…​FIXME

Note
cachedColumnBuffers is used when…​FIXME

PartitionStatistics

Note
PartitionStatistics is a private[columnar] class.

PartitionStatistics…​FIXME

Note
PartitionStatistics is used exclusively when InMemoryRelation is created (and initializes partitionStatistics).
赞(0) 打赏
未经允许不得转载:spark技术分享 » InMemoryRelation
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏