cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

WWoman
New Contributor III

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?

 

 

2 REPLIES 2

Rishabh-Pandey
Honored Contributor II

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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!