Is there a way to create a local CSV file by creating a local external table?

WWoman
Databricks Partner

Hello,

I have a user that would like to create a CSV file on their local file system by creating an external table (USING CSV) and specifying a local file for the path parameter using SQL. They will be running this command from a local client (DbVisualizer) and would like to create the CSV file on their local filesystem.

I know this can be accomplished using python, but we need a solution using SQL. Is this possible?

 

 

Rishabh-Pandey
Databricks MVP

Creating a CSV file on a local filesystem directly using SQL commands isn't typically supported in most SQL databases because SQL, by design, is not intended to interact with the local file system directly from a client like DbVisualizer. SQL is generally used for querying and managing data within a database server environment rather than interacting with local files on a client machine.

Rishabh Pandey

-werners-
Esteemed Contributor III

not sure if this would work, but you could run Unity Catalog locally (possible since last week) and define the csv file as a table in that local UC. then query it.