cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get import error logs in HANA Cloud?

nickporter
Explorer
0 Kudos
225

I'm importing some datasets to SAP HANA Cloud, using IMPORT FROM.

Here's the maneuver:

CREATE TABLE "FOO"."BAR" (
  id   VARCHAR(256) PRIMARY KEY
  name NVARCHAR(5000) NOT NULL
  ts TIMESTAMP NOT NULL
);

IMPORT FROM PARQUET FILE
'gs://foo/bar/000000000000.parquet'
INTO "FOO"."BAR"
WITH
FAIL ON INVALID DATA
CREDENTIAL 'GCS'
COLUMN LIST (id, name, ts)
FILE COLUMN LIST (1,2,3);

If there's an issue with the file, like a NULL, the import fails with a generic  some of rows have failed to be imported error.

For on prem, I can use the ERROR LOG option to get a error log. But in Hana Cloud, this options makes the import fail immediately. It makes sense; I don't think there's a filesystem I would even be able access even if the ERROR LOG file option did work, right?

So, how can I get file import error details, when importing into a HANA Cloud instance?

Accepted Solutions (0)

Answers (2)

Answers (2)

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

I believe the IMPORT FROM SQL statement has an option named ERROR LOG that specifies the name of the file to record the additional details in.  It is saved in the same location as the file that is being imported.  Additional details can be found at https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/i... 

Hope that helps,
Dan

nickporter
Explorer
0 Kudos
Right, unfortunatly this option isn't supported when importing PARQUET files. But even if it was supported, it's a little bit weird when importing from remote sources (gcs in my example). It means we'd have to give hana write permissions to GCS? Feels like there must be some view or a trace instead?
nickporter
Explorer
0 Kudos

In case it helps anyone, my current workaround is to create a sql-on-files external table, and doing an upsert instead.