[MCOL-5506] columnstore_info.load_from_s3 returns: Error getting OID for table Created: 2023-06-06  Updated: 2023-10-27  Resolved: 2023-10-27

Status: Closed
Project: MariaDB ColumnStore
Component/s: cpimport
Affects Version/s: 23.02.3
Fix Version/s: 23.10

Type: Bug Priority: Minor
Reporter: Geoff Montee (Inactive) Assignee: Leonid Fedorov
Resolution: Fixed Votes: 0
Labels: None

Attachments: File junk_data.csv    
Issue Links:
Relates
relates to MCOL-5013 Support Load data from AWS S3 : UDF... Closed
relates to MCOL-5013 Support Load data from AWS S3 : UDF... Closed

 Description   

I tested out the columnstore_info.load_from_s3 stored procedure in 2 different environments:

  • ColumnStore service in SkySQL
  • Local ColumnStore Docker container

In both environments, the stored procedure fails with an odd error that suggests the table name is being formed incorrectly:

{"error": "Unable to set default JobID; Error getting OID for table \".db1: MCS-2006: '\".db1' does not exist in Columnstore.\ncpimport.bin[3369]: 43.740453 |0|0|0| E 34 CAL0087: BulkLoad Error: Unable to set default JobID; Error getting OID for table \".db1: MCS-2006: '\".db1' does not exist in Columnstore.\n"}

Steps to reproduce

1. Create an S3 bucket

2. Upload the following file to it:

3. Create an IAM user to access the bucket and obtain their access key and secret key.

4. Deploy ColumnStore.

5. Connect to the ColumnStore node.

6. Create some objects:

CREATE DATABASE db1;
 
CREATE TABLE db1.tab1 (
   id INT,
   color varchar(50),
   quantity INT
) ENGINE=ColumnStore;

7. Set the S3 details in your session:

SET columnstore_s3_key='S3_KEY';
SET columnstore_s3_secret='S3_SECRET';
SET columnstore_s3_region='S3_REGION';

8. Call the stored procedure:

CALL columnstore_info.load_from_s3('s3://gmontee-columnstore-data-load',
      'junk_data.csv',
      'db1',
      'tab1',
      '\n',
      '"',
      '\\');

9. Check the table contents:

SELECT * FROM db1.tab1;

Actual results

It seems to be constructing the table name incorrectly, so an error is being raised:

MariaDB [(none)]> CALL columnstore_info.load_from_s3('s3://gmontee-columnstore-data-load',
    ->       'junk_data.csv',
    ->       'db1',
    ->       'tab1',
    ->       '\n',
    ->       '"',
    ->       '\\');
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| columnstore_dataload(bucket, filename, dbname, table_name, terminated_by, enclosed_by, escaped_by)                                                                                                                                                                                                                        |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {"error": "Unable to set default JobID; Error getting OID for table \".db1: MCS-2006: '\".db1' does not exist in Columnstore.\ncpimport.bin[3741]: 26.207180 |0|0|0| E 34 CAL0087: BulkLoad Error: Unable to set default JobID; Error getting OID for table \".db1: MCS-2006: '\".db1' does not exist in Columnstore.\n"} |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (1.222 sec)
 
Query OK, 0 rows affected (1.222 sec)
 
MariaDB [(none)]> SELECT * FROM db1.tab1;
Empty set (0.067 sec)

Expected results

The table name is "db1.tab1" not "\".db1".


Generated at Thu Feb 08 02:58:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.