Create Data Sinks

Copy-paste examples of how to create data sinks with SQL

Several authentication schemes across multiple providers are supported. For a detailed overview of all of the provider-specific options, see the SQL documentation.

Note

Creating an authenticated data sink requires creating a corresponding credential object to store the authentication information and then referencing that object when creating the data sink. See Create Credentials for examples.

Amazon S3

1
2
3
4
5
6
7
8
CREATE DATA SINK s3_dsink
LOCATION = 'S3'
WITH OPTIONS
(
    CREDENTIAL = 's3_cred',
    BUCKET NAME = 'samplebucket',
    REGION = 'us-east-2'
)

Azure BLOB

1
2
3
4
5
6
7
CREATE DATA SINK azure_dsink
LOCATION = 'AZURE'
WITH OPTIONS
(
    CREDENTIAL = 'azure_cred',
    CONTAINER NAME = 'samplecontainer'
)

CData

Credential
1
2
3
CREATE DATA SINK cdata_dsink
LOCATION = 'jdbc:postgresql:Server=localhost;Port=5432;Database=ki_home'
WITH OPTIONS (CREDENTIAL = 'cdata_cred')
Password in URL
1
2
CREATE DATA SINK cdata_dsink
LOCATION = 'jdbc:postgresql:Server=localhost;Port=5432;Database=ki_home;User=dsink_user;Password=dsink_pass'

Google Cloud Storage

1
2
3
4
5
6
7
CREATE DATA SINK gcs_dsink
LOCATION = 'GCS'
WITH OPTIONS
(
    CREDENTIAL = 'gcs_cred',
    GCS_BUCKET_NAME = 'gcs-private'
)

HDFS

1
2
3
CREATE DATA SINK hdfs_dsink
LOCATION = 'HDFS://example.com:8020'
WITH OPTIONS (CREDENTIAL = 'hdfs_cred')

JDBC

1
2
3
4
5
6
7
8
CREATE DATA SINK jdbc_dsink
LOCATION = 'jdbc:postgresql://localhost:5432/ki_home'
WITH OPTIONS
(
    CREDENTIAL = 'jdbc_cred',
    JDBC_DRIVER_CLASS_NAME = 'org.postgresql.Driver',
    JDBC_DRIVER_JAR_PATH = 'kifs://drivers/postgresql.jar'
)

Apache Kafka

Credential
1
2
3
4
5
6
7
CREATE DATA SINK kafka_dsink
LOCATION = 'kafka://example.com:9092'
WITH OPTIONS
(
    KAFKA_TOPIC_NAME = 'sample',
    CREDENTIAL = 'kafka_cred'
)
Public (No Auth)
1
2
3
4
5
6
CREATE DATA SINK kafka_dsink
LOCATION = 'kafka://example.com:9092'
WITH OPTIONS
(
    KAFKA_TOPIC_NAME = 'sample'
)

Web Hook

HTTP
1
2
CREATE DATA SINK http_dsink
LOCATION = 'http://example.com/webhook'
HTTPS
1
2
3
CREATE DATA SINK https_dsink
LOCATION = 'https://example.com/webhook'
WITH OPTIONS (CREDENTIAL = 'https_cred')