Skip to content

Commit 892a587

Browse files
committed
Update Cassandra v2
1 parent 56c5f08 commit 892a587

File tree

2 files changed

+79
-21
lines changed

2 files changed

+79
-21
lines changed

articles/data-factory/connector-cassandra.md

Lines changed: 79 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: jianleishen
66
ms.subservice: data-movement
77
ms.custom: synapse
88
ms.topic: conceptual
9-
ms.date: 10/20/2023
9+
ms.date: 02/28/2025
1010
ms.author: jianleishen
1111
---
1212
# Copy data from Cassandra using Azure Data Factory or Synapse Analytics
@@ -80,6 +80,7 @@ The following properties are supported for Cassandra linked service:
8080
| Property | Description | Required |
8181
|:--- |:--- |:--- |
8282
| type |The type property must be set to: **Cassandra** |Yes |
83+
| version | The version that you specify. The value is `2.0`. | Yes for version 2.0 |
8384
| host |One or more IP addresses or host names of Cassandra servers.<br/>Specify a comma-separated list of IP addresses or host names to connect to all servers concurrently. |Yes |
8485
| port |The TCP port that the Cassandra server uses to listen for client connections. |No (default is 9042) |
8586
| authenticationType | Type of authentication used to connect to the Cassandra database.<br/>Allowed values are: **Basic**, and **Anonymous**. |Yes |
@@ -90,7 +91,32 @@ The following properties are supported for Cassandra linked service:
9091
>[!NOTE]
9192
>Currently connection to Cassandra using TLS is not supported.
9293
93-
**Example:**
94+
**Example: version 2.0**
95+
96+
```json
97+
{
98+
"name": "CassandraLinkedService",
99+
"properties": {
100+
"type": "Cassandra",
101+
"version": "2.0",
102+
"typeProperties": {
103+
"host": "<host>",
104+
"authenticationType": "Basic",
105+
"username": "<username>",
106+
"password": {
107+
"type": "SecureString",
108+
"value": "<password>"
109+
}
110+
},
111+
"connectVia": {
112+
"referenceName": "<name of Integration Runtime>",
113+
"type": "IntegrationRuntimeReference"
114+
}
115+
}
116+
}
117+
```
118+
119+
**Example: version 1.0**
94120

95121
```json
96122
{
@@ -153,12 +179,12 @@ For a full list of sections and properties available for defining activities, se
153179

154180
### Cassandra as source
155181

156-
To copy data from Cassandra, set the source type in the copy activity to **CassandraSource**. The following properties are supported in the copy activity **source** section:
182+
If you use version 2.0 to copy data from Cassandra, set the source type in the copy activity to **CassandraSource**. The following properties are supported in the copy activity **source** section:
157183

158184
| Property | Description | Required |
159185
|:--- |:--- |:--- |
160186
| type | The type property of the copy activity source must be set to: **CassandraSource** | Yes |
161-
| query |Use the custom query to read data. SQL-92 query or CQL query. See [CQL reference](https://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlReferenceTOC.html). <br/><br/>When using SQL query, specify **keyspace name.table name** to represent the table you want to query. |No (if "tableName" and "keyspace" in dataset are specified). |
187+
| query |Use the custom query to read data. CQL query, see [CQL reference](https://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlReferenceTOC.html). <br/><br/>When using SQL query, specify **keyspace name.table name** to represent the table you want to query. |No (if "tableName" and "keyspace" in dataset are specified). |
162188
| consistencyLevel |The consistency level specifies how many replicas must respond to a read request before returning data to the client application. Cassandra checks the specified number of replicas for data to satisfy the read request. See [Configuring data consistency](https://docs.datastax.com/en/cassandra/2.1/cassandra/dml/dml_config_consistency_c.html) for details.<br/><br/>Allowed values are: **ONE**, **TWO**, **THREE**, **QUORUM**, **ALL**, **LOCAL_QUORUM**, **EACH_QUORUM**, and **LOCAL_ONE**. |No (default is `ONE`) |
163189

164190
**Example:**
@@ -193,27 +219,40 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
193219
]
194220
```
195221

222+
If you use version 1.0 to copy data from Cassandra, set the source type in the copy activity to **CassandraSource**. The following properties are supported in the copy activity **source** section:
223+
224+
| Property | Description | Required |
225+
|:--- |:--- |:--- |
226+
| type | The type property of the copy activity source must be set to: **CassandraSource** | Yes |
227+
| query |Use the custom query to read data. SQL-92 query or CQL query. See [CQL reference](https://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlReferenceTOC.html). <br/><br/>When using SQL query, specify **keyspace name.table name** to represent the table you want to query. |No (if "tableName" and "keyspace" in dataset are specified). |
228+
| consistencyLevel |The consistency level specifies how many replicas must respond to a read request before returning data to the client application. Cassandra checks the specified number of replicas for data to satisfy the read request. See [Configuring data consistency](https://docs.datastax.com/en/cassandra/2.1/cassandra/dml/dml_config_consistency_c.html) for details.<br/><br/>Allowed values are: **ONE**, **TWO**, **THREE**, **QUORUM**, **ALL**, **LOCAL_QUORUM**, **EACH_QUORUM**, and **LOCAL_ONE**. |No (default is `ONE`) |
229+
196230
## Data type mapping for Cassandra
197231

198232
When copying data from Cassandra, the following mappings are used from Cassandra data types to interim data types used internally within the service. See [Schema and data type mappings](copy-activity-schema-and-type-mapping.md) to learn about how copy activity maps the source schema and data type to the sink.
199233

200-
| Cassandra data type | Interim service data type |
201-
|:--- |:--- |
202-
| ASCII |String |
203-
| BIGINT |Int64 |
204-
| BLOB |Byte[] |
205-
| BOOLEAN |Boolean |
206-
| DECIMAL |Decimal |
207-
| DOUBLE |Double |
208-
| FLOAT |Single |
209-
| INET |String |
210-
| INT |Int32 |
211-
| TEXT |String |
212-
| TIMESTAMP |DateTime |
213-
| TIMEUUID |Guid |
214-
| UUID |Guid |
215-
| VARCHAR |String |
216-
| VARINT |Decimal |
234+
| Cassandra data type | Interim service data type (for version 2.0) | Interim service data type (for version 1.0) |
235+
|:--- |:--- |:--- |
236+
| ASCII |String |String |
237+
| BIGINT |Int64 |Int64 |
238+
| BLOB |Byte[] |Byte[] |
239+
| BOOLEAN |Boolean |Boolean |
240+
| COUNTER | Int64 | Unsupport |
241+
| DATE | IDate | Unsupport |
242+
| DECIMAL |Decimal |Decimal |
243+
| DOUBLE |Double |Double |
244+
| DURATION | Int64 | Unsupport |
245+
| FLOAT |Single |Single |
246+
| INET |String |String |
247+
| INT |Int32 |Int32 |
248+
| SMALLINT | Short | Unsupport |
249+
| TEXT |String |String |
250+
| TIMESTAMP |DateTime |DateTime |
251+
| TIMEUUID |Guid |Guid |
252+
| TINYINT | SByte | Unsupport |
253+
| UUID |Guid |Guid |
254+
| VARCHAR |String |String |
255+
| VARINT |Decimal |Decimal |
217256

218257
> [!NOTE]
219258
> For collection types (map, set, list, etc.), refer to [Work with Cassandra collection types using virtual table](#work-with-collections-using-virtual-table) section.
@@ -288,5 +327,24 @@ The following tables show the virtual tables that renormalize the data from the
288327

289328
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
290329

330+
## Differences between Cassandra version 2.0 and version 1.0
331+
332+
The Cassandra connector version 2.0 offers new functionalities and is compatible with most features of version 1.0. The table below shows the feature differences between version 2.0 and version 1.0.
333+
334+
| version 2.0 | version 1.0 |
335+
| --- | --- |
336+
| Support CQL query. | Support SQL-92 query or CQL query. |
337+
| Support the following new data type mappings. <br><br> DATE -> IDate <br> SMALLINT -> Short <br> TINYINT -> SByte <br> COUNTER -> Int64 <br> DURATION -> Int64 | Unsupport the following new data type mappings. <br><br> DATE <br> SMALLINT <br> TINYINT <br> COUNTER <br> DURATION |
338+
339+
## Upgrade the Cassandra connector
340+
341+
Here are steps that help you upgrade the Cassandra connector:
342+
343+
1. In **Edit linked service** page, select **2.0 (Preview)** under **Version** and configure the linked service by referring to [linked service version 2.0 properties](#version-20).
344+
345+
2. If you use `query` in the copy activity source for version 2.0,Learn more about [Cassandra as source](#cassandra-as-source).
346+
347+
3. The data type mapping for version 2.0 is different from that for version 1.0. To learn the latest data type mapping, see [Data type mapping for Cassandra](#data-type-mapping-for-cassandra).
348+
291349
## Related content
292350
For a list of data stores supported as sources and sinks by the copy activity, see [supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).
5.36 KB
Loading

0 commit comments

Comments
 (0)