Skip to main content
Skip table of contents

AWS S3 Select Connector

You are looking at an older version of the documentation. The latest version is found here.

Amazon S3 Select can be used to filter the contents of an Amazon S3 object based on a simple structured query language (SQL) statement. The file name and data serialization format for the response must be specified as a metadata connector propery. Currently the connnector only supports the CSV file format.

SQL
BEGIN
CALL sysadmin.createConnection(name => 'f1', jbossCLITemplateName => 's3select',
connectionOrResourceAdapterProperties => 'region=eu-west-1,keyId=AKIAIJLWFALNYVYFOEMQ,secretKey="---------------------------",' ||
'bucketName=my-bucket,' ||
'metadata="\"sample.csv\" (\"ID\":\"integer\", \"Product\":\"string\",\"Price\":\"double\")"');
CALL sysadmin.createDataSource(name => 'f1', translator => 's3select', modelProperties => '', translatorProperties => '');
END;;
 
SELECT * FROM f1.sample_csv;

Several files may be specified within a single data source:

SQL
CALL sysadmin.createConnection(name => 'f2', jbossCLITemplateName => 's3select',
connectionOrResourceAdapterProperties => 'region=eu-west-1,keyId=AKIAIJLWFALNYVYFOEMQ,secretKey="---------------------------",' ||
'bucketName=my-bucket,' ||
'metadata="\"sample.csv\" (\"ID\":\"integer\", \"Product\":\"string\",\"Price\":\"double\")"' ||
' "\"sample2.csv\" (\"CustomerId\":\"integer\", \"CustomerName\":\"string\")"');
CALL sysadmin.createDataSource(name => 'f2', translator => 's3select', modelProperties => '', translatorProperties => '');
 
SELECT * FROM f2.sample2_csv;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.