From 0e40cc9285dbb28167e43af494c09e413aee080c Mon Sep 17 00:00:00 2001 From: Thomas Bestfleisch Date: Mon, 14 Apr 2025 09:59:10 +0000 Subject: [PATCH] Added CSV import --- doc/data_ingestion.rst | 55 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/doc/data_ingestion.rst b/doc/data_ingestion.rst index f4b3653..04d2f02 100644 --- a/doc/data_ingestion.rst +++ b/doc/data_ingestion.rst @@ -1,8 +1,59 @@ Data Ingestion ============== -CSV Files ---------- +Importing CSV from AWS S3 into Exasol +------------------------------------- +This example demonstrates how to import a CSV file from AWS S3 into Exasol using the `IMPORT FROM CSV` command. + +Step 1: Create a Virtual Schema Connection +------------------------------------------ + +Establish a connection to your AWS S3 bucket using your AWS credentials: + +.. code-block:: sql + + CREATE CONNECTION S3_MY_BUCKET + TO 'http://.s3..amazonaws.com' + USER '' + IDENTIFIED BY ''; + +Step 2: Create a Table +---------------------- + +Define the structure of the target table where the data from the CSV file will be stored: + +.. code-block:: sql + + CREATE TABLE sales_data ( + order_id INT, + product_name VARCHAR(100), + quantity INT, + price DOUBLE + ); + +Step 3: Import Data +------------------- + +Execute the `IMPORT FROM CSV` command using the defined connection and specifying the details of the CSV file, such as its location, column separators, and encoding: + +.. code-block:: sql + + IMPORT INTO sales_data + FROM CSV + AT S3_MY_BUCKET + FILE 'sales_2025/sales.csv' + COLUMN SEPARATOR = ';' + ROW SEPARATOR = 'CRLF' + COLUMN DELIMITER = '"' + ENCODING = 'UTF-8' + SKIP = 1; + +.. note:: + Make sure to replace `my-access-key`, `my-secret-access`, `my-bucket-name` with your actual AWS S3 credentials. + +For more detailed information and additional options, refer to the Exasol documentation at: `Exasol Documentation `. + + Parquet Files -------------