Details
- 
    Bug 
- 
    Status: Closed (View Workflow)
- 
    Minor 
- 
    Resolution: Fixed
- 
    23.02.3
- 
    None
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".
