databricks.getDbfsFile
Explore with Pulumi AI
Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.
This data source allows to get file content from Databricks File System (DBFS).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const report = databricks.getDbfsFile({
path: "dbfs:/reports/some.csv",
limitFileSize: true,
});
import pulumi
import pulumi_databricks as databricks
report = databricks.get_dbfs_file(path="dbfs:/reports/some.csv",
limit_file_size=True)
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 {
_, err := databricks.LookupDbfsFile(ctx, &databricks.LookupDbfsFileArgs{
Path: "dbfs:/reports/some.csv",
LimitFileSize: true,
}, nil)
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 report = Databricks.GetDbfsFile.Invoke(new()
{
Path = "dbfs:/reports/some.csv",
LimitFileSize = true,
});
});
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.GetDbfsFileArgs;
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 report = DatabricksFunctions.getDbfsFile(GetDbfsFileArgs.builder()
.path("dbfs:/reports/some.csv")
.limitFileSize("true")
.build());
}
}
variables:
report:
fn::invoke:
Function: databricks:getDbfsFile
Arguments:
path: dbfs:/reports/some.csv
limitFileSize: 'true'
Related Resources
The following resources are used in the same context:
- End to end workspace management guide.
- databricks.getDbfsFilePaths data to get list of file names from get file content from Databricks File System (DBFS).
- databricks.DbfsFile to manage relatively small files on Databricks File System (DBFS).
- databricks.Mount to mount your cloud storage on
dbfs:/mnt/name
.
Using getDbfsFile
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 getDbfsFile(args: GetDbfsFileArgs, opts?: InvokeOptions): Promise<GetDbfsFileResult>
function getDbfsFileOutput(args: GetDbfsFileOutputArgs, opts?: InvokeOptions): Output<GetDbfsFileResult>
def get_dbfs_file(limit_file_size: Optional[bool] = None,
path: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDbfsFileResult
def get_dbfs_file_output(limit_file_size: Optional[pulumi.Input[bool]] = None,
path: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDbfsFileResult]
func LookupDbfsFile(ctx *Context, args *LookupDbfsFileArgs, opts ...InvokeOption) (*LookupDbfsFileResult, error)
func LookupDbfsFileOutput(ctx *Context, args *LookupDbfsFileOutputArgs, opts ...InvokeOption) LookupDbfsFileResultOutput
> Note: This function is named LookupDbfsFile
in the Go SDK.
public static class GetDbfsFile
{
public static Task<GetDbfsFileResult> InvokeAsync(GetDbfsFileArgs args, InvokeOptions? opts = null)
public static Output<GetDbfsFileResult> Invoke(GetDbfsFileInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDbfsFileResult> getDbfsFile(GetDbfsFileArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getDbfsFile:getDbfsFile
arguments:
# arguments dictionary
The following arguments are supported:
- Limit
File boolSize - Do not load content for files larger than 4MB.
- Path string
- Path on DBFS for the file from which to get content.
- Limit
File boolSize - Do not load content for files larger than 4MB.
- Path string
- Path on DBFS for the file from which to get content.
- limit
File BooleanSize - Do not load content for files larger than 4MB.
- path String
- Path on DBFS for the file from which to get content.
- limit
File booleanSize - Do not load content for files larger than 4MB.
- path string
- Path on DBFS for the file from which to get content.
- limit_
file_ boolsize - Do not load content for files larger than 4MB.
- path str
- Path on DBFS for the file from which to get content.
- limit
File BooleanSize - Do not load content for files larger than 4MB.
- path String
- Path on DBFS for the file from which to get content.
getDbfsFile Result
The following output properties are available:
- Content string
- base64-encoded file contents
- File
Size int - size of the file in bytes
- Id string
- The provider-assigned unique ID for this managed resource.
- Limit
File boolSize - Path string
- Content string
- base64-encoded file contents
- File
Size int - size of the file in bytes
- Id string
- The provider-assigned unique ID for this managed resource.
- Limit
File boolSize - Path string
- content String
- base64-encoded file contents
- file
Size Integer - size of the file in bytes
- id String
- The provider-assigned unique ID for this managed resource.
- limit
File BooleanSize - path String
- content string
- base64-encoded file contents
- file
Size number - size of the file in bytes
- id string
- The provider-assigned unique ID for this managed resource.
- limit
File booleanSize - path string
- content str
- base64-encoded file contents
- file_
size int - size of the file in bytes
- id str
- The provider-assigned unique ID for this managed resource.
- limit_
file_ boolsize - path str
- content String
- base64-encoded file contents
- file
Size Number - size of the file in bytes
- id String
- The provider-assigned unique ID for this managed resource.
- limit
File BooleanSize - path String
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.