stegus64
01/29/2026, 10:43 AMCOPY INTO "sling"."dimemployee_tmp" ("WKEmployee", "EmployeeKey", "EmployeeName", "pnr", "AgreementFromDate", "AgreementToDate", "AgreementName", "AgreementHourly", "EmploymentType", "src", "period_fromdate", "period_todate", "DW_ValidFrom", "DW_ValidTo")
FROM 'XXXX/part.01.0001.csv.gz'
WITH (
FILE_TYPE = 'CSV',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
FIRSTROW = 2,
COMPRESSION = 'Gzip',
ENCODING = 'UTF8'
)
But it always inserts 0 rows.
It turns out that the syntax '\n' is not supported when reading from csv.gz, instead you need to write it like this:
COPY INTO "sling"."dimemployee_tmp" ("WKEmployee", "EmployeeKey", "EmployeeName", "pnr", "AgreementFromDate", "AgreementToDate", "AgreementName", "AgreementHourly", "EmploymentType", "src", "period_fromdate", "period_todate", "DW_ValidFrom", "DW_ValidTo")
FROM 'XXXX/part.01.0001.csv.gz'
WITH (
FILE_TYPE = 'CSV',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '0x0A', // <--------- HERE
FIRSTROW = 2,
COMPRESSION = 'Gzip',
ENCODING = 'UTF8'
)
This works fine.flarco
01/29/2026, 10:57 PMfabric.yaml with:
yaml
core:
copy_from_onelake_csv: |
COPY INTO {table} ({tgt_columns})
FROM '{onelake_path}'
WITH (
FILE_TYPE = 'CSV',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '0x0A',
FIRSTROW = 2,
COMPRESSION = 'Gzip',
ENCODING = 'UTF8'{credential_expr}
)