ibm-cloudobject-storagecloud-object-storage

Edit object data in IBM Cloud Object Storage or skip the first few rows when reading data


How to edit object data in IBM Cloud Object Storage or skip the first few rows when reading data.

I want to edit my files on IBM COS by using API directly, do we have any API can help to achieve? Thanks!


Solution

  • For now, I got a new way to read COS data if you want to skip first row in COS file, you can use SKIPROWS to skip row by create EXTERNAL table.

    SELECT *
    FROM EXTERNAL 'data.csv'
        (COLUMN_1 VARCHAR(60 OCTETS), COLUMN_2 VARCHAR(60 OCTETS))
    USING (
        delimiter ','
        ***SKIPROWS 1***
        s3(
            's3.us-south.cloud-object-storage.appdomain.cloud',
            'access_key_id',
            'secret_access_key',
            'bucket_name'
        )
    );