Packages

c

org.apache.spark.sql.execution.columnar

DefaultCachedBatchSerializer

class DefaultCachedBatchSerializer extends SimpleMetricsCachedBatchSerializer

The default implementation of CachedBatchSerializer.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultCachedBatchSerializer
  2. SimpleMetricsCachedBatchSerializer
  3. Logging
  4. CachedBatchSerializer
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DefaultCachedBatchSerializer()

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def MDC(key: LogKey, value: Any): MDC
    Attributes
    protected
    Definition Classes
    Logging
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def buildFilter(predicates: Seq[Expression], cachedAttributes: Seq[Attribute]): (Int, Iterator[CachedBatch]) => Iterator[CachedBatch]

    Builds a function that can be used to filter batches prior to being decompressed.

    Builds a function that can be used to filter batches prior to being decompressed. In most cases extending SimpleMetricsCachedBatchSerializer will provide the filter logic necessary. You will need to provide metrics for this to work. SimpleMetricsCachedBatch provides the APIs to hold those metrics and explains the metrics used, really just min and max. Note that this is intended to skip batches that are not needed, and the actual filtering of individual rows is handled later.

    predicates

    the set of expressions to use for filtering.

    cachedAttributes

    the schema/attributes of the data that is cached. This can be helpful if you don't store it with the data.

    returns

    a function that takes the partition id and the iterator of batches in the partition. It returns an iterator of batches that should be decompressed.

    Definition Classes
    SimpleMetricsCachedBatchSerializerCachedBatchSerializer
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. def convertCachedBatchToColumnarBatch(input: RDD[CachedBatch], cacheAttributes: Seq[Attribute], selectedAttributes: Seq[Attribute], conf: SQLConf): RDD[ColumnarBatch]

    Convert the cached data into a ColumnarBatch.

    Convert the cached data into a ColumnarBatch. This currently is only used if supportsColumnarOutput() returns true for the associated schema, but there are other checks that can force row based output. One of the main advantages of doing columnar output over row based output is that the code generation is more standard and can be combined with code generation for downstream operations.

    input

    the cached batches that should be converted.

    cacheAttributes

    the attributes of the data in the batch.

    selectedAttributes

    the fields that should be loaded from the data and the order they should appear in the output batch.

    conf

    the configuration for the job.

    returns

    an RDD of the input cached batches transformed into the ColumnarBatch format.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  9. def convertCachedBatchToInternalRow(input: RDD[CachedBatch], cacheAttributes: Seq[Attribute], selectedAttributes: Seq[Attribute], conf: SQLConf): RDD[InternalRow]

    Convert the cached batch into InternalRows.

    Convert the cached batch into InternalRows. If you want this to be performant, code generation is advised.

    input

    the cached batches that should be converted.

    cacheAttributes

    the attributes of the data in the batch.

    selectedAttributes

    the field that should be loaded from the data and the order they should appear in the output rows.

    conf

    the configuration for the job.

    returns

    RDD of the rows that were stored in the cached batches.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  10. def convertColumnarBatchToCachedBatch(input: RDD[ColumnarBatch], schema: Seq[Attribute], storageLevel: StorageLevel, conf: SQLConf): RDD[CachedBatch]

    Convert an RDD[ColumnarBatch] into an RDD[CachedBatch] in preparation for caching the data.

    Convert an RDD[ColumnarBatch] into an RDD[CachedBatch] in preparation for caching the data. This will only be called if supportsColumnarInput() returned true for the given schema and the plan up to this point would could produce columnar output without modifying it.

    input

    the input RDD to be converted.

    schema

    the schema of the data being stored.

    storageLevel

    where the data will be stored.

    conf

    the config for the query.

    returns

    The data converted into a format more suitable for caching.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  11. def convertForCacheInternal(input: RDD[InternalRow], output: Seq[Attribute], batchSize: Int, useCompression: Boolean): RDD[CachedBatch]
  12. def convertInternalRowToCachedBatch(input: RDD[InternalRow], schema: Seq[Attribute], storageLevel: StorageLevel, conf: SQLConf): RDD[CachedBatch]

    Convert an RDD[InternalRow] into an RDD[CachedBatch] in preparation for caching the data.

    Convert an RDD[InternalRow] into an RDD[CachedBatch] in preparation for caching the data.

    input

    the input RDD to be converted.

    schema

    the schema of the data being stored.

    storageLevel

    where the data will be stored.

    conf

    the config for the query.

    returns

    The data converted into a format more suitable for caching.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  13. def convertToColumnarPlanIfPossible(plan: SparkPlan): SparkPlan

    Attempt to convert a query plan to its columnar equivalence for columnar caching.

    Attempt to convert a query plan to its columnar equivalence for columnar caching. Called on the query plan that is about to be cached once supportsColumnarInput returns true on its output schema.

    The default implementation works by stripping the topmost columnar-to-row transition to expose the columnar-based plan to the serializer.

    plan

    The plan to convert.

    returns

    The output plan. Could either be a columnar plan if the input plan is convertible, or the input plan unchanged if no viable conversion can be done.

    Definition Classes
    CachedBatchSerializer
    Annotations
    @DeveloperApi() @Since("4.1.0")
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  18. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  19. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  22. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  23. def logBasedOnLevel(level: Level)(f: => MessageWithContext): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  32. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  33. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  34. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  37. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  42. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  44. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  47. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  48. def supportsColumnarInput(schema: Seq[Attribute]): Boolean

    Can convertColumnarBatchToCachedBatch() be called instead of convertInternalRowToCachedBatch() for this given schema? True if it can and false if it cannot.

    Can convertColumnarBatchToCachedBatch() be called instead of convertInternalRowToCachedBatch() for this given schema? True if it can and false if it cannot. Columnar input is only supported if the plan could produce columnar output. Currently this is mostly supported by input formats like parquet and orc, but more operations are likely to be supported soon.

    schema

    the schema of the data being stored.

    returns

    True if columnar input can be supported, else false.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  49. def supportsColumnarOutput(schema: StructType): Boolean

    Can convertCachedBatchToColumnarBatch() be called instead of convertCachedBatchToInternalRow() for this given schema? True if it can and false if it cannot.

    Can convertCachedBatchToColumnarBatch() be called instead of convertCachedBatchToInternalRow() for this given schema? True if it can and false if it cannot. Columnar output is typically preferred because it is more efficient. Note that convertCachedBatchToInternalRow() must always be supported as there are other checks that can force row based output.

    schema

    the schema of the data being checked.

    returns

    true if columnar output should be used for this schema, else false.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  50. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. def vectorTypes(attributes: Seq[Attribute], conf: SQLConf): Option[Seq[String]]

    The exact java types of the columns that are output in columnar processing mode.

    The exact java types of the columns that are output in columnar processing mode. This is a performance optimization for code generation and is optional.

    attributes

    the attributes to be output.

    conf

    the config for the query that will read the data.

    Definition Classes
    DefaultCachedBatchSerializerCachedBatchSerializer
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  55. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  56. def withLogContext(context: Map[String, String])(body: => Unit): Unit
    Attributes
    protected
    Definition Classes
    Logging

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Logging

Inherited from CachedBatchSerializer

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped