# Class TableInfo (2.65.0)

2.65.0 (latest) 2.62.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.2 2.56.0 2.55.3 2.54.2 2.53.0 2.52.0 2.51.0 2.50.1 2.49.0 2.48.1 2.47.0 2.46.0 2.45.0 2.44.0 2.43.3 2.42.3 2.41.0 2.40.3 2.39.1 2.38.2 2.37.2 2.36.0 2.35.0 2.34.2 2.33.2

    public class TableInfo implements Serializable

Google BigQuery table information. Use [StandardTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.StandardTableDefinition) to create simple BigQuery
table. Use [ViewDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ViewDefinition) to create a BigQuery view. Use [ExternalTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ExternalTableDefinition)
to create a BigQuery a table backed by external data.
See Also: [Managing Tables](https://cloud.google.com/bigquery/docs/tables)

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> TableInfo

## Implements

[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### newBuilder(TableId tableId, TableDefinition definition)

    public static TableInfo.Builder newBuilder(TableId tableId, TableDefinition definition)

Returns a builder for a `TableInfo` object given table identity and definition. Use
[StandardTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.StandardTableDefinition) to create simple BigQuery table. Use [ViewDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ViewDefinition) to
create a BigQuery view. Use [ExternalTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ExternalTableDefinition) to create a BigQuery a table backed
by external data.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tableId` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableId` |
| `definition` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableDefinition` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableInfo.Builder` |   |

### of(TableId tableId, TableDefinition definition)

    public static TableInfo of(TableId tableId, TableDefinition definition)

Returns a `TableInfo` object given table identity and definition. Use [StandardTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.StandardTableDefinition) to create simple BigQuery table. Use [ViewDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ViewDefinition) to create
a BigQuery view. Use [ExternalTableDefinition](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.ExternalTableDefinition) to create a BigQuery a table backed by
external data.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tableId` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableId` |
| `definition` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableDefinition` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableInfo` |   |

## Methods

### \<T\>getDefinition()

    public T <T>getDefinition()

Returns the table definition.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `T` |   |

### equals(Object obj)

    public boolean equals(Object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getCloneDefinition()

    public CloneDefinition getCloneDefinition()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CloneDefinition` |   |

### getCreationTime()

    public Long getCreationTime()

Returns the time when this table was created, in milliseconds since the epoch.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getDefaultCollation()

    public String getDefaultCollation()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getDescription()

    public String getDescription()

Returns a user-friendly description for the table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getEncryptionConfiguration()

    public EncryptionConfiguration getEncryptionConfiguration()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.EncryptionConfiguration` |   |

### getEtag()

    public String getEtag()

Returns the hash of the table resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getExpirationTime()

    public Long getExpirationTime()

Returns the time when this table expires, in milliseconds since the epoch. If not present, the
table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getFriendlyName()

    public String getFriendlyName()

Returns a user-friendly name for the table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getGeneratedId()

    public String getGeneratedId()

Returns the service-generated id for the table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLabels()

    public Map<String,String> getLabels()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Return a map for labels applied to the table.

Unstable, because labels are [experimental](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLastModifiedTime()

    public Long getLastModifiedTime()

Returns the time when this table was last modified, in milliseconds since the epoch.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumActiveLogicalBytes()

    public Long getNumActiveLogicalBytes()

Returns the number of active logical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumActivePhysicalBytes()

    public Long getNumActivePhysicalBytes()

Returns the number of active physical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumBytes()

    public Long getNumBytes()

Returns the size of this table in bytes

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumLongTermBytes()

    public Long getNumLongTermBytes()

Returns the number of bytes considered "long-term storage" for reduced billing purposes.
See Also: [Long Term Storage Pricing](https://cloud.google.com/bigquery/pricing#long-term-storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumLongTermLogicalBytes()

    public Long getNumLongTermLogicalBytes()

Returns the number of long term logical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumLongTermPhysicalBytes()

    public Long getNumLongTermPhysicalBytes()

Returns the number of long term physical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumRows()

    public BigInteger getNumRows()

Returns the number of rows of data in this table

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html` |   |

### getNumTimeTravelPhysicalBytes()

    public Long getNumTimeTravelPhysicalBytes()

Returns the number of time travel physical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumTotalLogicalBytes()

    public Long getNumTotalLogicalBytes()

Returns the number of total logical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getNumTotalPhysicalBytes()

    public Long getNumTotalPhysicalBytes()

Returns the number of total physical bytes.
See Also: [Storage Pricing](https://cloud.google.com/bigquery/pricing#storage)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getOtelAttributes()

    protected Attributes getOtelAttributes()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `io.opentelemetry.api.common.Attributes` |   |

### getRequirePartitionFilter()

    public Boolean getRequirePartitionFilter()

Returns true if a partition filter (that can be used for partition elimination) is required for
queries over this table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |

### getResourceTags()

    public Map<String,String> getResourceTags()

Return a map for resource tags applied to the table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getSelfLink()

    public String getSelfLink()

Returns an URL that can be used to access the resource again. The returned URL can be used for
get or update requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getTableConstraints()

    public TableConstraints getTableConstraints()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableConstraints` |   |

### getTableId()

    public TableId getTableId()

Returns the table identity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableId` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### toBuilder()

    public TableInfo.Builder toBuilder()

Returns a builder for the table object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.TableInfo.Builder` |   |

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)