CONNECT Statements
- reference
This topic describes how you use CONNECT statements to connect all of the remote collections on a given link or links to their specified data sources, and start data ingestion.
You incur charges when you connect a remote link.
The CONNECT statement applies only to remote links, and is not applicable to external links.
CONNECT statements cannot execute while the cluster is in a scaling state.
The evaluation of such DDL statements fails.
You can reattempt the action after scaling is complete.
|
Syntax
ConnectStmnt EBNF
ConnectStmnt ::= "CONNECT" "LINK" LinkSpecification
( "WITH" ObjectConstructor )
ConnectStmnt Diagram
The LinkSpecification is a comma-separated list of one or more link names to connect.
Show LinkSpecification
Example
The following example connects the remote link called myCbLink and starts receiving data for all of the remote collections on that link.
CONNECT LINK myCbLink;
After you use CONNECT and have completed your initial data ingest, you can run ANALYZE COLLECTION on each collection associated with the link.
The ANALYZE statement samples data in the collection so that cost-based optimization (CBO) can be applied instead of rule-based optimization.
As data in the collections changes, you can run ANALYZE COLLECTION periodically to refresh the samples.
See Cost-Based Optimizer for Enterprise Analytics Services.
Arguments
- WITH
-
The
WITHclause enables you to provide parameters for the connection. TheObjectConstructorrepresents a JSON object containing key-value pairs, one for each parameter. You can define the following parameter.
| Name | Description | Schema |
|---|---|---|
force |
Applies to remote links for a Couchbase data service only. |
Boolean |