Interface Table

All Known Implementing Classes:
AllDataFilesTable, AllDeleteFilesTable, AllEntriesTable, AllFilesTable, AllManifestsTable, BaseMetadataTable, BaseTable, BaseTransaction.TransactionTable, DataFilesTable, DeleteFilesTable, FilesTable, HistoryTable, ManifestEntriesTable, ManifestsTable, MetadataLogEntriesTable, PartitionsTable, PositionDeletesTable, RefsTable, SerializableTable, SerializableTable.SerializableMetadataTable, SerializableTableWithSize, SerializableTableWithSize.SerializableMetadataTableWithSize, SnapshotsTable

public interface Table
Represents a table.
  • Method Details Link icon

    • name Link icon

      default String name()
      Return the full name for this table.
      Returns:
      this table's name
    • refresh Link icon

      void refresh()
      Refresh the current table metadata.
    • newScan Link icon

      TableScan newScan()
      Create a new scan for this table.

      Once a table scan is created, it can be refined to project columns and filter data.

      Returns:
      a table scan for this table
    • newBatchScan Link icon

      default BatchScan newBatchScan()
      Create a new batch scan for this table.

      Once a batch scan is created, it can be refined to project columns and filter data.

      Returns:
      a batch scan for this table
    • newIncrementalAppendScan Link icon

      default IncrementalAppendScan newIncrementalAppendScan()
      Create a new scan for this table.

      Once a scan is created, it can be refined to project columns and filter data.

      Returns:
      an incremental scan for appends only snapshots
    • newIncrementalChangelogScan Link icon

      default IncrementalChangelogScan newIncrementalChangelogScan()
      Create a new IncrementalChangelogScan for this table.

      Once a scan is created, it can be refined to project columns and filter data.

      Returns:
      an incremental changelog scan
    • schema Link icon

      Schema schema()
      Return the schema for this table.
      Returns:
      this table's schema
    • schemas Link icon

      Map<Integer,Schema> schemas()
      Return a map of schema for this table.
      Returns:
      this table's schema map
    • spec Link icon

      Return the partition spec for this table.
      Returns:
      this table's partition spec
    • specs Link icon

      Return a map of partition specs for this table.
      Returns:
      this table's partition specs map
    • sortOrder Link icon

      SortOrder sortOrder()
      Return the sort order for this table.
      Returns:
      this table's sort order
    • sortOrders Link icon

      Map<Integer,SortOrder> sortOrders()
      Return a map of sort order IDs to sort orders for this table.
      Returns:
      this table's sort orders map
    • properties Link icon

      Map<String,String> properties()
      Return a map of string properties for this table.
      Returns:
      this table's properties map
    • location Link icon

      String location()
      Return the table's base location.
      Returns:
      this table's location
    • currentSnapshot Link icon

      Snapshot currentSnapshot()
      Get the current snapshot for this table, or null if there are no snapshots.
      Returns:
      the current table Snapshot.
    • snapshot Link icon

      Snapshot snapshot(long snapshotId)
      Get the snapshot of this table with the given id, or null if there is no matching snapshot.
      Returns:
      the Snapshot with the given id.
    • snapshots Link icon

      Iterable<Snapshot> snapshots()
      Get the snapshots of this table.
      Returns:
      an Iterable of snapshots of this table.
    • history Link icon

      List<HistoryEntry> history()
      Get the snapshot history of this table.
      Returns:
      a list of history entries
    • updateSchema Link icon

      UpdateSchema updateSchema()
      Create a new UpdateSchema to alter the columns of this table and commit the change.
      Returns:
      a new UpdateSchema
    • updateSpec Link icon

      UpdatePartitionSpec updateSpec()
      Create a new UpdatePartitionSpec to alter the partition spec of this table and commit the change.
      Returns:
      a new UpdatePartitionSpec
    • updateProperties Link icon

      UpdateProperties updateProperties()
      Create a new UpdateProperties to update table properties and commit the changes.
      Returns:
      a new UpdateProperties
    • replaceSortOrder Link icon

      ReplaceSortOrder replaceSortOrder()
      Create a new ReplaceSortOrder to set the table sort order and commit the change.
      Returns:
      a new ReplaceSortOrder
    • updateLocation Link icon

      UpdateLocation updateLocation()
      Create a new UpdateLocation to update table location and commit the changes.
      Returns:
      a new UpdateLocation
    • newAppend Link icon

      AppendFiles newAppend()
      Create a new append API to add files to this table and commit.
      Returns:
      a new AppendFiles
    • newFastAppend Link icon

      default AppendFiles newFastAppend()
      Create a new append API to add files to this table and commit.

      Using this method signals to the underlying implementation that the append should not perform extra work in order to commit quickly. Fast appends are not recommended for normal writes because the fast commit may cause split planning to slow down over time.

      Implementations may not support fast appends, in which case this will return the same appender as newAppend().

      Returns:
      a new AppendFiles
    • newRewrite Link icon

      RewriteFiles newRewrite()
      Create a new rewrite API to replace files in this table and commit.
      Returns:
      a new RewriteFiles
    • rewriteManifests Link icon

      RewriteManifests rewriteManifests()
      Create a new rewrite manifests API to replace manifests for this table and commit.
      Returns:
      a new RewriteManifests
    • newOverwrite Link icon

      OverwriteFiles newOverwrite()
      Create a new overwrite API to overwrite files by a filter expression.
      Returns:
      a new OverwriteFiles
    • newRowDelta Link icon

      RowDelta newRowDelta()
      Create a new row-level delta API to remove or replace rows in existing data files.
      Returns:
      a new RowDelta
    • newReplacePartitions Link icon

      ReplacePartitions newReplacePartitions()
      Not recommended: Create a new replace partitions API to dynamically overwrite partitions in the table with new data.

      This is provided to implement SQL compatible with Hive table operations but is not recommended. Instead, use the overwrite API to explicitly overwrite data.

      Returns:
      a new ReplacePartitions
    • newDelete Link icon

      DeleteFiles newDelete()
      Create a new delete API to delete files in this table and commit.
      Returns:
      a new DeleteFiles
    • updateStatistics Link icon

      default UpdateStatistics updateStatistics()
      Create a new update table statistics API to add or remove statistics files in this table.
      Returns:
      a new UpdateStatistics
    • updatePartitionStatistics Link icon

      default UpdatePartitionStatistics updatePartitionStatistics()
      Create a new update partition statistics API to add or remove partition statistics files in this table.
      Returns:
      a new UpdatePartitionStatistics
    • expireSnapshots Link icon

      ExpireSnapshots expireSnapshots()
      Create a new expire API to expire snapshots in this table and commit.
      Returns:
      a new ExpireSnapshots
    • manageSnapshots Link icon

      ManageSnapshots manageSnapshots()
      Create a new manage snapshots API to manage snapshots in this table and commit.
      Returns:
      a new ManageSnapshots
    • newTransaction Link icon

      Transaction newTransaction()
      Create a new transaction API to commit multiple table operations at once.
      Returns:
      a new Transaction
    • io Link icon

      FileIO io()
      Returns a FileIO to read and write table data and metadata files.
    • encryption Link icon

      EncryptionManager encryption()
      Returns an EncryptionManager to encrypt and decrypt data files.
    • locationProvider Link icon

      LocationProvider locationProvider()
      Returns a LocationProvider to provide locations for new data files.
    • statisticsFiles Link icon

      List<StatisticsFile> statisticsFiles()
      Returns the current statistics files for the table
      Returns:
      the current statistics files for the table
    • partitionStatisticsFiles Link icon

      default List<PartitionStatisticsFile> partitionStatisticsFiles()
      Returns the current partition statistics files for the table.
    • refs Link icon

      Returns the current refs for the table
      Returns:
      the current refs for the table
    • uuid Link icon

      default UUID uuid()
      Returns the UUID of the table
      Returns:
      the UUID of the table
    • snapshot Link icon

      default Snapshot snapshot(String name)
      Returns the snapshot referenced by the given name or null if no such reference exists.
      Returns:
      the snapshot which is referenced by the given name or null if no such reference exists.