In our case, the file is in an S3 bucket. That means, that we can use Native Object Storage (NOS) to ingest the data:
-- create an S3-backed foreign table
CREATE FOREIGN TABLE irs_returns_nos
USING ( LOCATION('/s3/s3.amazonaws.com/irs-form-990/index_2020.csv') );
-- load the data into a native table
CREATE MULTISET TABLE irs_returns_nos_native
(RETURN_ID, FILING_TYPE, EIN, TAX_PERIOD, SUB_DATE, TAXPAYER_NAME)
AS (
SELECT RETURN_ID, FILING_TYPE, EIN, TAX_PERIOD, SUB_DATE, TAXPAYER_NAME FROM irs_returns_nos
) WITH DATA
NO PRIMARY INDEX;
The NOS solution is convenient as it doesn't depend on additional tools. It can be implemented using only SQL. It performs well, especially for Teradata database deployments with a high number of AMPs as NOS tasks are delegated to AMPs and run in parallel. Also, splitting the data in object storage into multiple files may further improve performance.