Class SnapshotReportImpl

Object
io.delta.kernel.internal.metrics.DeltaOperationReportImpl
io.delta.kernel.internal.metrics.SnapshotReportImpl
All Implemented Interfaces:
DeltaOperationReport, MetricsReport, SnapshotReport

public class SnapshotReportImpl extends DeltaOperationReportImpl implements SnapshotReport
A basic POJO implementation of SnapshotReport for creating them
  • Method Details

    • forError

      public static SnapshotReport forError(SnapshotQueryContext snapshotContext, Exception e)
      Creates a SnapshotReport for a failed snapshot query.
      Parameters:
      snapshotContext - context/metadata about the snapshot query
      e - the exception that was thrown
    • forSuccess

      public static SnapshotReport forSuccess(SnapshotQueryContext snapshotContext)
      Creates a SnapshotReport for a successful snapshot query.
      Parameters:
      snapshotContext - context/metadata about the snapshot query
    • getSnapshotMetrics

      public SnapshotMetricsResult getSnapshotMetrics()
      Specified by:
      getSnapshotMetrics in interface SnapshotReport
      Returns:
      the metrics for this snapshot construction
    • getVersion

      public Optional<Long> getVersion()
      Description copied from interface: SnapshotReport
      For a time-travel by version query, this is the version provided. For a time-travel by timestamp query, this is the version resolved from the provided timestamp. For a latest snapshot, this is the version read from the delta log.

      This is empty when this report is for a failed snapshot construction, and the error occurs before a version can be resolved.

      Specified by:
      getVersion in interface SnapshotReport
      Returns:
      the version of the snapshot
    • getCheckpointVersion

      public Optional<Long> getCheckpointVersion()
      Specified by:
      getCheckpointVersion in interface SnapshotReport
      Returns:
      the version of the checkpoint used for this snapshot, empty if no checkpoint was used or if this is a failed snapshot construction
    • getProvidedTimestamp

      public Optional<Long> getProvidedTimestamp()
      Specified by:
      getProvidedTimestamp in interface SnapshotReport
      Returns:
      the timestamp provided for time-travel, empty if this is not a timestamp-based time-travel query
    • toJson

      public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
      Description copied from interface: MetricsReport
      Converts this metrics report to a JSON string representation.
      Specified by:
      toJson in interface MetricsReport
      Returns:
      a JSON string representation of this metrics report
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the report cannot be serialized to JSON