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)
// Output-based functions aren't available in Java yet
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
 - 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
 - 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
 - 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
 - table
Info 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
 - table
Info 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.
 - 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.
 - 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.
 - 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.
 - table
Info 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.
 - table
Info Property Map - TableInfo object for a Unity Catalog table. This contains the following attributes:
 
Supporting Types
GetTableTableInfo   
- Access
Point string - Browse
Only bool - Catalog
Name string - Name of parent catalog.
 - Columns
List<Get
Table Table Info Column>  - Array of ColumnInfo objects of the table's columns
 - Comment string
 - Free-form text description
 - Created
At int - Created
By string - Data
Access stringConfiguration Id  - Data
Source stringFormat  - 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 stringOptimization  - Encryption
Details GetTable Table Info Encryption Details  - Full
Name string - Metastore
Id string - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Owner string
 - Current owner of the table
 - Pipeline
Id string - Properties Dictionary<string, string>
 - Row
Filter GetTable Table Info Row Filter  - Schema
Name string - Name of parent schema relative to its parent catalog.
 - Sql
Path string - Storage
Credential stringName  - Storage
Location string - Table
Constraints List<GetTable Table Info Table Constraint>  - Table
Id string - Table
Type string - Table type, e.g. MANAGED, EXTERNAL, VIEW
 - Updated
At int - Updated
By string - View
Definition string - 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) 
- Access
Point string - Browse
Only bool - Catalog
Name string - Name of parent catalog.
 - Columns
[]Get
Table Table Info Column  - Array of ColumnInfo objects of the table's columns
 - Comment string
 - Free-form text description
 - Created
At int - Created
By string - Data
Access stringConfiguration Id  - Data
Source stringFormat  - 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 stringOptimization  - Encryption
Details GetTable Table Info Encryption Details  - Full
Name string - Metastore
Id string - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Owner string
 - Current owner of the table
 - Pipeline
Id string - Properties map[string]string
 - Row
Filter GetTable Table Info Row Filter  - Schema
Name string - Name of parent schema relative to its parent catalog.
 - Sql
Path string - Storage
Credential stringName  - Storage
Location string - Table
Constraints []GetTable Table Info Table Constraint  - Table
Id string - Table
Type string - Table type, e.g. MANAGED, EXTERNAL, VIEW
 - Updated
At int - Updated
By string - View
Definition string - 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) 
- access
Point String - browse
Only Boolean - catalog
Name String - Name of parent catalog.
 - columns
List<Get
Table Table Info Column>  - Array of ColumnInfo objects of the table's columns
 - comment String
 - Free-form text description
 - created
At Integer - created
By String - data
Access StringConfiguration Id  - data
Source StringFormat  - Table format, e.g. DELTA, CSV, JSON
 - deleted
At Integer - delta
Runtime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs  - effective
Predictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag  - enable
Predictive StringOptimization  - encryption
Details GetTable Table Info Encryption Details  - full
Name String - metastore
Id String - name String
 - Full name of the databricks_table: 
catalog.schema.table - owner String
 - Current owner of the table
 - pipeline
Id String - properties Map<String,String>
 - row
Filter GetTable Table Info Row Filter  - schema
Name String - Name of parent schema relative to its parent catalog.
 - sql
Path String - storage
Credential StringName  - storage
Location String - table
Constraints List<GetTable Table Info Table Constraint>  - table
Id String - table
Type String - Table type, e.g. MANAGED, EXTERNAL, VIEW
 - updated
At Integer - updated
By String - view
Definition String - 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) 
- access
Point string - browse
Only boolean - catalog
Name string - Name of parent catalog.
 - columns
Get
Table Table Info Column[]  - Array of ColumnInfo objects of the table's columns
 - comment string
 - Free-form text description
 - created
At number - created
By string - data
Access stringConfiguration Id  - data
Source stringFormat  - Table format, e.g. DELTA, CSV, JSON
 - deleted
At number - delta
Runtime GetProperties Kvpairs Table Table Info Delta Runtime Properties Kvpairs  - effective
Predictive GetOptimization Flag Table Table Info Effective Predictive Optimization Flag  - enable
Predictive stringOptimization  - encryption
Details GetTable Table Info Encryption Details  - full
Name string - metastore
Id string - name string
 - Full name of the databricks_table: 
catalog.schema.table - owner string
 - Current owner of the table
 - pipeline
Id string - properties {[key: string]: string}
 - row
Filter GetTable Table Info Row Filter  - schema
Name string - Name of parent schema relative to its parent catalog.
 - sql
Path string - storage
Credential stringName  - storage
Location string - table
Constraints GetTable Table Info Table Constraint[]  - table
Id string - table
Type string - Table type, e.g. MANAGED, EXTERNAL, VIEW
 - updated
At number - updated
By string - view
Definition string - 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) 
- access_
point str - browse_
only bool - catalog_
name str - Name of parent catalog.
 - columns
Sequence[Get
Table 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) 
- access
Point String - browse
Only Boolean - catalog
Name String - Name of parent catalog.
 - columns List<Property Map>
 - Array of ColumnInfo objects of the table's columns
 - comment String
 - Free-form text description
 - created
At Number - created
By String - data
Access StringConfiguration Id  - data
Source StringFormat  - Table format, e.g. DELTA, CSV, JSON
 - deleted
At Number - delta
Runtime Property MapProperties Kvpairs  - effective
Predictive Property MapOptimization Flag  - enable
Predictive StringOptimization  - encryption
Details Property Map - full
Name String - metastore
Id String - name String
 - Full name of the databricks_table: 
catalog.schema.table - owner String
 - Current owner of the table
 - pipeline
Id String - properties Map<String>
 - row
Filter Property Map - schema
Name String - Name of parent schema relative to its parent catalog.
 - sql
Path String - storage
Credential StringName  - storage
Location String - table
Constraints List<Property Map> - table
Id String - table
Type String - Table type, e.g. MANAGED, EXTERNAL, VIEW
 - updated
At Number - updated
By String - view
Definition String - View definition SQL (when 
table_typeis VIEW, MATERIALIZED_VIEW, or STREAMING_TABLE) - view
Dependencies Property Map - View dependencies (when 
table_typeis VIEW or MATERIALIZED_VIEW, STREAMING_TABLE) 
GetTableTableInfoColumn    
- Comment string
 - Free-form text description
 - Mask
Get
Table Table Info Column Mask  - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Nullable bool
 - Partition
Index int - Position int
 - Type
Interval stringType  - Type
Json string - Type
Name string - Type
Precision int - Type
Scale int - Type
Text string 
- Comment string
 - Free-form text description
 - Mask
Get
Table Table Info Column Mask  - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Nullable bool
 - Partition
Index int - Position int
 - Type
Interval stringType  - Type
Json string - Type
Name string - Type
Precision int - Type
Scale int - Type
Text string 
- comment String
 - Free-form text description
 - mask
Get
Table Table Info Column Mask  - name String
 - Full name of the databricks_table: 
catalog.schema.table - nullable Boolean
 - partition
Index Integer - position Integer
 - type
Interval StringType  - type
Json String - type
Name String - type
Precision Integer - type
Scale Integer - type
Text String 
- comment string
 - Free-form text description
 - mask
Get
Table Table Info Column Mask  - name string
 - Full name of the databricks_table: 
catalog.schema.table - nullable boolean
 - partition
Index number - position number
 - type
Interval stringType  - type
Json string - type
Name string - type
Precision number - type
Scale number - type
Text string 
- comment str
 - Free-form text description
 - mask
Get
Table 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
 - partition
Index Number - position Number
 - type
Interval StringType  - type
Json String - type
Name String - type
Precision Number - type
Scale Number - type
Text String 
GetTableTableInfoColumnMask     
- Function
Name string - Using
Column List<string>Names  
- Function
Name string - Using
Column []stringNames  
- function
Name String - using
Column List<String>Names  
- function
Name string - using
Column string[]Names  
- function_
name str - using_
column_ Sequence[str]names  
- function
Name String - using
Column List<String>Names  
GetTableTableInfoDeltaRuntimePropertiesKvpairs       
- Delta
Runtime Dictionary<string, string>Properties  
- Delta
Runtime map[string]stringProperties  
- delta
Runtime Map<String,String>Properties  
- delta
Runtime {[key: string]: string}Properties  
- delta_
runtime_ Mapping[str, str]properties  
- delta
Runtime Map<String>Properties  
GetTableTableInfoEffectivePredictiveOptimizationFlag       
- Value string
 - Inherited
From stringName  - Inherited
From stringType  
- Value string
 - Inherited
From stringName  - Inherited
From stringType  
- value String
 - inherited
From StringName  - inherited
From StringType  
- value string
 - inherited
From stringName  - inherited
From stringType  
- value str
 - inherited_
from_ strname  - inherited_
from_ strtype  
- value String
 - inherited
From StringName  - inherited
From StringType  
GetTableTableInfoEncryptionDetails     
GetTableTableInfoEncryptionDetailsSseEncryptionDetails        
- Algorithm string
 - Aws
Kms stringKey Arn  
- Algorithm string
 - Aws
Kms stringKey Arn  
- algorithm String
 - aws
Kms StringKey Arn  
- algorithm string
 - aws
Kms stringKey Arn  
- algorithm str
 - aws_
kms_ strkey_ arn  
- algorithm String
 - aws
Kms StringKey Arn  
GetTableTableInfoRowFilter     
- Function
Name string - Input
Column List<string>Names  
- Function
Name string - Input
Column []stringNames  
- function
Name String - input
Column List<String>Names  
- function
Name string - input
Column string[]Names  
- function_
name str - input_
column_ Sequence[str]names  
- function
Name String - input
Column List<String>Names  
GetTableTableInfoTableConstraint     
GetTableTableInfoTableConstraintForeignKeyConstraint        
- Child
Columns List<string> - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Parent
Columns List<string> - Parent
Table string 
- Child
Columns []string - Name string
 - Full name of the databricks_table: 
catalog.schema.table - Parent
Columns []string - Parent
Table string 
- child
Columns List<String> - name String
 - Full name of the databricks_table: 
catalog.schema.table - parent
Columns List<String> - parent
Table String 
- child
Columns string[] - name string
 - Full name of the databricks_table: 
catalog.schema.table - parent
Columns string[] - parent
Table string 
- child_
columns Sequence[str] - name str
 - Full name of the databricks_table: 
catalog.schema.table - parent_
columns Sequence[str] - parent_
table str 
- child
Columns List<String> - name String
 - Full name of the databricks_table: 
catalog.schema.table - parent
Columns List<String> - parent
Table 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        
- Child
Columns List<string> - Name string
 - Full name of the databricks_table: 
catalog.schema.table 
- Child
Columns []string - Name string
 - Full name of the databricks_table: 
catalog.schema.table 
- child
Columns List<String> - name String
 - Full name of the databricks_table: 
catalog.schema.table 
- child
Columns 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 
- child
Columns List<String> - name String
 - Full name of the databricks_table: 
catalog.schema.table 
GetTableTableInfoViewDependencies     
GetTableTableInfoViewDependenciesDependency      
GetTableTableInfoViewDependenciesDependencyFunction       
- Function
Full stringName  
- Function
Full stringName  
- function
Full StringName  
- function
Full stringName  
- function
Full StringName  
GetTableTableInfoViewDependenciesDependencyTable       
- Table
Full stringName  
- Table
Full stringName  
- table
Full StringName  
- table
Full stringName  
- table_
full_ strname  
- table
Full StringName  
Package Details
- Repository
 - databricks pulumi/pulumi-databricks
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
databricksTerraform Provider.