databricks.getTable
Explore with Pulumi AI
Note This data source can only be used with a workspace-level provider!
Note If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.
Retrieves details of a specific table in Unity Catalog, that were created by Pulumi or manually. Use databricks.getTables to retrieve multiple tables in Unity Catalog
Example Usage
Read on a specific table main.certified.fct_transactions:
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const fctTransactions = databricks.getTable({
    name: "main.certified.fct_transactions",
});
const things = new databricks.Grants("things", {
    table: fctTransactions.then(fctTransactions => fctTransactions.name),
    grants: [{
        principal: "sensitive",
        privileges: [
            "SELECT",
            "MODIFY",
        ],
    }],
});
import pulumi
import pulumi_databricks as databricks
fct_transactions = databricks.get_table(name="main.certified.fct_transactions")
things = databricks.Grants("things",
    table=fct_transactions.name,
    grants=[{
        "principal": "sensitive",
        "privileges": [
            "SELECT",
            "MODIFY",
        ],
    }])
package main
import (
	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fctTransactions, err := databricks.LookupTable(ctx, &databricks.LookupTableArgs{
			Name: "main.certified.fct_transactions",
		}, nil)
		if err != nil {
			return err
		}
		_, err = databricks.NewGrants(ctx, "things", &databricks.GrantsArgs{
			Table: pulumi.String(fctTransactions.Name),
			Grants: databricks.GrantsGrantArray{
				&databricks.GrantsGrantArgs{
					Principal: pulumi.String("sensitive"),
					Privileges: pulumi.StringArray{
						pulumi.String("SELECT"),
						pulumi.String("MODIFY"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() => 
{
    var fctTransactions = Databricks.GetTable.Invoke(new()
    {
        Name = "main.certified.fct_transactions",
    });
    var things = new Databricks.Grants("things", new()
    {
        Table = fctTransactions.Apply(getTableResult => getTableResult.Name),
        GrantDetails = new[]
        {
            new Databricks.Inputs.GrantsGrantArgs
            {
                Principal = "sensitive",
                Privileges = new[]
                {
                    "SELECT",
                    "MODIFY",
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetTableArgs;
import com.pulumi.databricks.Grants;
import com.pulumi.databricks.GrantsArgs;
import com.pulumi.databricks.inputs.GrantsGrantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var fctTransactions = DatabricksFunctions.getTable(GetTableArgs.builder()
            .name("main.certified.fct_transactions")
            .build());
        var things = new Grants("things", GrantsArgs.builder()
            .table(fctTransactions.applyValue(getTableResult -> getTableResult.name()))
            .grants(GrantsGrantArgs.builder()
                .principal("sensitive")
                .privileges(                
                    "SELECT",
                    "MODIFY")
                .build())
            .build());
    }
}
resources:
  things:
    type: databricks:Grants
    properties:
      table: ${fctTransactions.name}
      grants:
        - principal: sensitive
          privileges:
            - SELECT
            - MODIFY
variables:
  fctTransactions:
    fn::invoke:
      function: databricks:getTable
      arguments:
        name: main.certified.fct_transactions
Related Resources
The following resources are used in the same context:
- databricks.Grant to manage grants within Unity Catalog.
- databricks.getTables to list all tables within a schema in Unity Catalog.
Using getTable
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTable(args: GetTableArgs, opts?: InvokeOptions): Promise<GetTableResult>
function getTableOutput(args: GetTableOutputArgs, opts?: InvokeOptions): Output<GetTableResult>def get_table(id: Optional[str] = None,
              name: Optional[str] = None,
              table_info: Optional[GetTableTableInfo] = None,
              opts: Optional[InvokeOptions] = None) -> GetTableResult
def get_table_output(id: Optional[pulumi.Input[str]] = None,
              name: Optional[pulumi.Input[str]] = None,
              table_info: Optional[pulumi.Input[GetTableTableInfoArgs]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTableResult]func LookupTable(ctx *Context, args *LookupTableArgs, opts ...InvokeOption) (*LookupTableResult, error)
func LookupTableOutput(ctx *Context, args *LookupTableOutputArgs, opts ...InvokeOption) LookupTableResultOutput> Note: This function is named LookupTable in the Go SDK.
public static class GetTable 
{
    public static Task<GetTableResult> InvokeAsync(GetTableArgs args, InvokeOptions? opts = null)
    public static Output<GetTableResult> Invoke(GetTableInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTableResult> getTable(GetTableArgs args, InvokeOptions options)
public static Output<GetTableResult> getTable(GetTableArgs args, InvokeOptions options)
fn::invoke:
  function: databricks:index/getTable:getTable
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Full name of the databricks_table: catalog.schema.table
- Id string
- TableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- Name string
- Full name of the databricks_table: catalog.schema.table
- Id string
- TableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- name String
- Full name of the databricks_table: catalog.schema.table
- id String
- tableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- name string
- Full name of the databricks_table: catalog.schema.table
- id string
- tableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- name str
- Full name of the databricks_table: catalog.schema.table
- id str
- table_info GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- name String
- Full name of the databricks_table: catalog.schema.table
- id String
- tableInfo Property Map
- TableInfo object for a Unity Catalog table. This contains the following attributes:
getTable Result
The following output properties are available:
- Id string
- Name string
- Name of table, relative to parent schema.
- TableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- Id string
- Name string
- Name of table, relative to parent schema.
- TableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- id String
- name String
- Name of table, relative to parent schema.
- tableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- id string
- name string
- Name of table, relative to parent schema.
- tableInfo GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- id str
- name str
- Name of table, relative to parent schema.
- table_info GetTable Table Info 
- TableInfo object for a Unity Catalog table. This contains the following attributes:
- id String
- name String
- Name of table, relative to parent schema.
- tableInfo Property Map
- TableInfo object for a Unity Catalog table. This contains the following attributes:
Supporting Types
GetTableTableInfo   
- AccessPoint string
- BrowseOnly bool
- CatalogName string
- Name of parent catalog.
- Columns
List<GetTable Table Info Column> 
- Array of ColumnInfo objects of the table's columns
- Comment string
- Free-form text description
- CreatedAt int
- CreatedBy string
- DataAccess stringConfiguration Id 
- DataSource stringFormat 
- Table format, e.g. DELTA, CSV, JSON
- DeletedAt int
- DeltaRuntime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs 
- EffectivePredictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag 
- EnablePredictive stringOptimization 
- EncryptionDetails GetTable Table Info Encryption Details 
- FullName string
- MetastoreId string
- Name string
- Full name of the databricks_table: catalog.schema.table
- Owner string
- Current owner of the table
- PipelineId string
- Properties Dictionary<string, string>
- RowFilter GetTable Table Info Row Filter 
- SchemaName string
- Name of parent schema relative to its parent catalog.
- SqlPath string
- StorageCredential stringName 
- StorageLocation string
- TableConstraints List<GetTable Table Info Table Constraint> 
- TableId string
- TableType string
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- UpdatedAt int
- UpdatedBy string
- ViewDefinition string
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- ViewDependencies GetTable Table Info View Dependencies 
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
- AccessPoint string
- BrowseOnly bool
- CatalogName string
- Name of parent catalog.
- Columns
[]GetTable Table Info Column 
- Array of ColumnInfo objects of the table's columns
- Comment string
- Free-form text description
- CreatedAt int
- CreatedBy string
- DataAccess stringConfiguration Id 
- DataSource stringFormat 
- Table format, e.g. DELTA, CSV, JSON
- DeletedAt int
- DeltaRuntime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs 
- EffectivePredictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag 
- EnablePredictive stringOptimization 
- EncryptionDetails GetTable Table Info Encryption Details 
- FullName string
- MetastoreId string
- Name string
- Full name of the databricks_table: catalog.schema.table
- Owner string
- Current owner of the table
- PipelineId string
- Properties map[string]string
- RowFilter GetTable Table Info Row Filter 
- SchemaName string
- Name of parent schema relative to its parent catalog.
- SqlPath string
- StorageCredential stringName 
- StorageLocation string
- TableConstraints []GetTable Table Info Table Constraint 
- TableId string
- TableType string
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- UpdatedAt int
- UpdatedBy string
- ViewDefinition string
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- ViewDependencies GetTable Table Info View Dependencies 
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
- accessPoint String
- browseOnly Boolean
- catalogName String
- Name of parent catalog.
- columns
List<GetTable Table Info Column> 
- Array of ColumnInfo objects of the table's columns
- comment String
- Free-form text description
- createdAt Integer
- createdBy String
- dataAccess StringConfiguration Id 
- dataSource StringFormat 
- Table format, e.g. DELTA, CSV, JSON
- deletedAt Integer
- deltaRuntime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs 
- effectivePredictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag 
- enablePredictive StringOptimization 
- encryptionDetails GetTable Table Info Encryption Details 
- fullName String
- metastoreId String
- name String
- Full name of the databricks_table: catalog.schema.table
- owner String
- Current owner of the table
- pipelineId String
- properties Map<String,String>
- rowFilter GetTable Table Info Row Filter 
- schemaName String
- Name of parent schema relative to its parent catalog.
- sqlPath String
- storageCredential StringName 
- storageLocation String
- tableConstraints List<GetTable Table Info Table Constraint> 
- tableId String
- tableType String
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- updatedAt Integer
- updatedBy String
- viewDefinition String
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- viewDependencies GetTable Table Info View Dependencies 
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
- accessPoint string
- browseOnly boolean
- catalogName string
- Name of parent catalog.
- columns
GetTable Table Info Column[] 
- Array of ColumnInfo objects of the table's columns
- comment string
- Free-form text description
- createdAt number
- createdBy string
- dataAccess stringConfiguration Id 
- dataSource stringFormat 
- Table format, e.g. DELTA, CSV, JSON
- deletedAt number
- deltaRuntime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs 
- effectivePredictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag 
- enablePredictive stringOptimization 
- encryptionDetails GetTable Table Info Encryption Details 
- fullName string
- metastoreId string
- name string
- Full name of the databricks_table: catalog.schema.table
- owner string
- Current owner of the table
- pipelineId string
- properties {[key: string]: string}
- rowFilter GetTable Table Info Row Filter 
- schemaName string
- Name of parent schema relative to its parent catalog.
- sqlPath string
- storageCredential stringName 
- storageLocation string
- tableConstraints GetTable Table Info Table Constraint[] 
- tableId string
- tableType string
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- updatedAt number
- updatedBy string
- viewDefinition string
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- viewDependencies GetTable Table Info View Dependencies 
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
- access_point str
- browse_only bool
- catalog_name str
- Name of parent catalog.
- columns
Sequence[GetTable Table Info Column] 
- Array of ColumnInfo objects of the table's columns
- comment str
- Free-form text description
- created_at int
- created_by str
- data_access_ strconfiguration_ id 
- data_source_ strformat 
- Table format, e.g. DELTA, CSV, JSON
- deleted_at int
- delta_runtime_ Getproperties_ kvpairs Table Table Info Delta Runtime Properties Kvpairs 
- effective_predictive_ Getoptimization_ flag Table Table Info Effective Predictive Optimization Flag 
- enable_predictive_ stroptimization 
- encryption_details GetTable Table Info Encryption Details 
- full_name str
- metastore_id str
- name str
- Full name of the databricks_table: catalog.schema.table
- owner str
- Current owner of the table
- pipeline_id str
- properties Mapping[str, str]
- row_filter GetTable Table Info Row Filter 
- schema_name str
- Name of parent schema relative to its parent catalog.
- sql_path str
- storage_credential_ strname 
- storage_location str
- table_constraints Sequence[GetTable Table Info Table Constraint] 
- table_id str
- table_type str
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- updated_at int
- updated_by str
- view_definition str
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- view_dependencies GetTable Table Info View Dependencies 
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
- accessPoint String
- browseOnly Boolean
- catalogName String
- Name of parent catalog.
- columns List<Property Map>
- Array of ColumnInfo objects of the table's columns
- comment String
- Free-form text description
- createdAt Number
- createdBy String
- dataAccess StringConfiguration Id 
- dataSource StringFormat 
- Table format, e.g. DELTA, CSV, JSON
- deletedAt Number
- deltaRuntime Property MapProperties Kvpairs 
- effectivePredictive Property MapOptimization Flag 
- enablePredictive StringOptimization 
- encryptionDetails Property Map
- fullName String
- metastoreId String
- name String
- Full name of the databricks_table: catalog.schema.table
- owner String
- Current owner of the table
- pipelineId String
- properties Map<String>
- rowFilter Property Map
- schemaName String
- Name of parent schema relative to its parent catalog.
- sqlPath String
- storageCredential StringName 
- storageLocation String
- tableConstraints List<Property Map>
- tableId String
- tableType String
- Table type, e.g. MANAGED, EXTERNAL, VIEW
- updatedAt Number
- updatedBy String
- viewDefinition String
- View definition SQL (when table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE)
- viewDependencies Property Map
- View dependencies (when table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE)
GetTableTableInfoColumn    
- Comment string
- Free-form text description
- Mask
GetTable Table Info Column Mask 
- Name string
- Full name of the databricks_table: catalog.schema.table
- Nullable bool
- PartitionIndex int
- Position int
- TypeInterval stringType 
- TypeJson string
- TypeName string
- TypePrecision int
- TypeScale int
- TypeText string
- Comment string
- Free-form text description
- Mask
GetTable Table Info Column Mask 
- Name string
- Full name of the databricks_table: catalog.schema.table
- Nullable bool
- PartitionIndex int
- Position int
- TypeInterval stringType 
- TypeJson string
- TypeName string
- TypePrecision int
- TypeScale int
- TypeText string
- comment String
- Free-form text description
- mask
GetTable Table Info Column Mask 
- name String
- Full name of the databricks_table: catalog.schema.table
- nullable Boolean
- partitionIndex Integer
- position Integer
- typeInterval StringType 
- typeJson String
- typeName String
- typePrecision Integer
- typeScale Integer
- typeText String
- comment string
- Free-form text description
- mask
GetTable Table Info Column Mask 
- name string
- Full name of the databricks_table: catalog.schema.table
- nullable boolean
- partitionIndex number
- position number
- typeInterval stringType 
- typeJson string
- typeName string
- typePrecision number
- typeScale number
- typeText string
- comment str
- Free-form text description
- mask
GetTable Table Info Column Mask 
- name str
- Full name of the databricks_table: catalog.schema.table
- nullable bool
- partition_index int
- position int
- type_interval_ strtype 
- type_json str
- type_name str
- type_precision int
- type_scale int
- type_text str
- comment String
- Free-form text description
- mask Property Map
- name String
- Full name of the databricks_table: catalog.schema.table
- nullable Boolean
- partitionIndex Number
- position Number
- typeInterval StringType 
- typeJson String
- typeName String
- typePrecision Number
- typeScale Number
- typeText String
GetTableTableInfoColumnMask     
- FunctionName string
- UsingColumn List<string>Names 
- FunctionName string
- UsingColumn []stringNames 
- functionName String
- usingColumn List<String>Names 
- functionName string
- usingColumn string[]Names 
- function_name str
- using_column_ Sequence[str]names 
- functionName String
- usingColumn List<String>Names 
GetTableTableInfoDeltaRuntimePropertiesKvpairs       
- DeltaRuntime Dictionary<string, string>Properties 
- DeltaRuntime map[string]stringProperties 
- deltaRuntime Map<String,String>Properties 
- deltaRuntime {[key: string]: string}Properties 
- delta_runtime_ Mapping[str, str]properties 
- deltaRuntime Map<String>Properties 
GetTableTableInfoEffectivePredictiveOptimizationFlag       
- Value string
- InheritedFrom stringName 
- InheritedFrom stringType 
- Value string
- InheritedFrom stringName 
- InheritedFrom stringType 
- value String
- inheritedFrom StringName 
- inheritedFrom StringType 
- value string
- inheritedFrom stringName 
- inheritedFrom stringType 
- value str
- inherited_from_ strname 
- inherited_from_ strtype 
- value String
- inheritedFrom StringName 
- inheritedFrom StringType 
GetTableTableInfoEncryptionDetails     
GetTableTableInfoEncryptionDetailsSseEncryptionDetails        
- Algorithm string
- AwsKms stringKey Arn 
- Algorithm string
- AwsKms stringKey Arn 
- algorithm String
- awsKms StringKey Arn 
- algorithm string
- awsKms stringKey Arn 
- algorithm str
- aws_kms_ strkey_ arn 
- algorithm String
- awsKms StringKey Arn 
GetTableTableInfoRowFilter     
- FunctionName string
- InputColumn List<string>Names 
- FunctionName string
- InputColumn []stringNames 
- functionName String
- inputColumn List<String>Names 
- functionName string
- inputColumn string[]Names 
- function_name str
- input_column_ Sequence[str]names 
- functionName String
- inputColumn List<String>Names 
GetTableTableInfoTableConstraint     
GetTableTableInfoTableConstraintForeignKeyConstraint        
- ChildColumns List<string>
- Name string
- Full name of the databricks_table: catalog.schema.table
- ParentColumns List<string>
- ParentTable string
- ChildColumns []string
- Name string
- Full name of the databricks_table: catalog.schema.table
- ParentColumns []string
- ParentTable string
- childColumns List<String>
- name String
- Full name of the databricks_table: catalog.schema.table
- parentColumns List<String>
- parentTable String
- childColumns string[]
- name string
- Full name of the databricks_table: catalog.schema.table
- parentColumns string[]
- parentTable string
- child_columns Sequence[str]
- name str
- Full name of the databricks_table: catalog.schema.table
- parent_columns Sequence[str]
- parent_table str
- childColumns List<String>
- name String
- Full name of the databricks_table: catalog.schema.table
- parentColumns List<String>
- parentTable String
GetTableTableInfoTableConstraintNamedTableConstraint        
- Name string
- Full name of the databricks_table: catalog.schema.table
- Name string
- Full name of the databricks_table: catalog.schema.table
- name String
- Full name of the databricks_table: catalog.schema.table
- name string
- Full name of the databricks_table: catalog.schema.table
- name str
- Full name of the databricks_table: catalog.schema.table
- name String
- Full name of the databricks_table: catalog.schema.table
GetTableTableInfoTableConstraintPrimaryKeyConstraint        
- ChildColumns List<string>
- Name string
- Full name of the databricks_table: catalog.schema.table
- ChildColumns []string
- Name string
- Full name of the databricks_table: catalog.schema.table
- childColumns List<String>
- name String
- Full name of the databricks_table: catalog.schema.table
- childColumns string[]
- name string
- Full name of the databricks_table: catalog.schema.table
- child_columns Sequence[str]
- name str
- Full name of the databricks_table: catalog.schema.table
- childColumns List<String>
- name String
- Full name of the databricks_table: catalog.schema.table
GetTableTableInfoViewDependencies     
GetTableTableInfoViewDependenciesDependency      
GetTableTableInfoViewDependenciesDependencyFunction       
- FunctionFull stringName 
- FunctionFull stringName 
- functionFull StringName 
- functionFull stringName 
- functionFull StringName 
GetTableTableInfoViewDependenciesDependencyTable       
- TableFull stringName 
- TableFull stringName 
- tableFull StringName 
- tableFull stringName 
- table_full_ strname 
- tableFull StringName 
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the databricksTerraform Provider.