<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Convert MySQL SELECT INTO OUTFILE and LOAD DATA INFILE to Databricks SQL? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-convert-mysql-select-into-outfile-and-load-data-infile-to/m-p/121272#M46401</link>
    <description>&lt;P&gt;Databricks SQL does not directly support MySQL’s SELECT INTO OUTFILE or LOAD DATA INFILE syntax. However, equivalent functionality can be achieved using Databricks features like saving to and reading from external locations like dbfs, s3 etc. I have used s3 when I wanted to load some master data in csv format from the s3 source.&lt;/P&gt;&lt;P&gt;CREATE OR REPLACE TEMP VIEW my_view AS SELECT * FROM my_table;&lt;BR /&gt;&lt;BR /&gt;Example of SELECT INTO OUTFILE equivalent&lt;/P&gt;&lt;P&gt;COPY INTO 'dbfs:/mnt/output/my_table/' FROM my_view FILEFORMAT = CSV FORMAT_OPTIONS ('header' = 'true');&lt;/P&gt;&lt;P&gt;Example of&amp;nbsp;LOAD DATA INFILE equivalent&lt;/P&gt;&lt;P&gt;COPY INTO my_table FROM 'dbfs:/mnt/input/my_table.csv' FILEFORMAT = CSV FORMAT_OPTIONS ('header' = 'true');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jun 2025 15:55:56 GMT</pubDate>
    <dc:creator>krishnakhadka28</dc:creator>
    <dc:date>2025-06-09T15:55:56Z</dc:date>
    <item>
      <title>How to Convert MySQL SELECT INTO OUTFILE and LOAD DATA INFILE to Databricks SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-convert-mysql-select-into-outfile-and-load-data-infile-to/m-p/121245#M46387</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I have some existing MySQL code :&lt;/P&gt;&lt;P&gt;SELECT * FROM [table_name]&lt;BR /&gt;INTO OUTFILE 'file_path'&lt;BR /&gt;FIELDS TERMINATED BY '\t'&lt;BR /&gt;OPTIONALLY ENCLOSED BY '"'&lt;BR /&gt;LINES TERMINATED BY '\n';&lt;/P&gt;&lt;P&gt;LOAD DATA INFILE 'file_path' REPLACE INTO TABLE [database].[table_name]&lt;BR /&gt;FIELDS TERMINATED BY '\t'&lt;BR /&gt;OPTIONALLY ENCLOSED BY '"'&lt;BR /&gt;LINES TERMINATED BY '\n';&lt;/P&gt;&lt;P&gt;How do I convert this exactly into Databricks SQL? I just want the equivalent syntax in Databricks SQL&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 10:08:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-convert-mysql-select-into-outfile-and-load-data-infile-to/m-p/121245#M46387</guid>
      <dc:creator>Akshay_Petkar</dc:creator>
      <dc:date>2025-06-09T10:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Convert MySQL SELECT INTO OUTFILE and LOAD DATA INFILE to Databricks SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-convert-mysql-select-into-outfile-and-load-data-infile-to/m-p/121272#M46401</link>
      <description>&lt;P&gt;Databricks SQL does not directly support MySQL’s SELECT INTO OUTFILE or LOAD DATA INFILE syntax. However, equivalent functionality can be achieved using Databricks features like saving to and reading from external locations like dbfs, s3 etc. I have used s3 when I wanted to load some master data in csv format from the s3 source.&lt;/P&gt;&lt;P&gt;CREATE OR REPLACE TEMP VIEW my_view AS SELECT * FROM my_table;&lt;BR /&gt;&lt;BR /&gt;Example of SELECT INTO OUTFILE equivalent&lt;/P&gt;&lt;P&gt;COPY INTO 'dbfs:/mnt/output/my_table/' FROM my_view FILEFORMAT = CSV FORMAT_OPTIONS ('header' = 'true');&lt;/P&gt;&lt;P&gt;Example of&amp;nbsp;LOAD DATA INFILE equivalent&lt;/P&gt;&lt;P&gt;COPY INTO my_table FROM 'dbfs:/mnt/input/my_table.csv' FILEFORMAT = CSV FORMAT_OPTIONS ('header' = 'true');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 15:55:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-convert-mysql-select-into-outfile-and-load-data-infile-to/m-p/121272#M46401</guid>
      <dc:creator>krishnakhadka28</dc:creator>
      <dc:date>2025-06-09T15:55:56Z</dc:date>
    </item>
  </channel>
</rss>

