Skip to content

Commit 9ab23df

Browse files
authored
Merge pull request #295505 from Lucky-Wang16/0227-Update_Cassandra_v2
[Doc update] Update Cassandra v2
2 parents 4e01d54 + 3905142 commit 9ab23df

File tree

2 files changed

+81
-25
lines changed

2 files changed

+81
-25
lines changed

articles/data-factory/connector-cassandra.md

Lines changed: 81 additions & 25 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
@@ -30,7 +30,8 @@ For a list of data stores that are supported as sources/sinks, see the [Supporte
3030

3131
Specifically, this Cassandra connector supports:
3232

33-
- Cassandra **versions 2.x and 3.x**.
33+
- Cassandra **versions 3.x.x and 4.x.x** for version 2.0.
34+
- Cassandra **versions 2.x and 3.x** for version 1.0.
3435
- Copying data using **Basic** or **Anonymous** authentication.
3536

3637
>[!NOTE]
@@ -80,6 +81,7 @@ The following properties are supported for Cassandra linked service:
8081
| Property | Description | Required |
8182
|:--- |:--- |:--- |
8283
| type |The type property must be set to: **Cassandra** |Yes |
84+
| version | The version that you specify. The value is `2.0`. | Yes for version 2.0, not supported for version 1.0. |
8385
| 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 |
8486
| port |The TCP port that the Cassandra server uses to listen for client connections. |No (default is 9042) |
8587
| authenticationType | Type of authentication used to connect to the Cassandra database.<br/>Allowed values are: **Basic**, and **Anonymous**. |Yes |
@@ -90,7 +92,32 @@ The following properties are supported for Cassandra linked service:
9092
>[!NOTE]
9193
>Currently connection to Cassandra using TLS is not supported.
9294
93-
**Example:**
95+
**Example: version 2.0 (Preview)**
96+
97+
```json
98+
{
99+
"name": "CassandraLinkedService",
100+
"properties": {
101+
"type": "Cassandra",
102+
"version": "2.0",
103+
"typeProperties": {
104+
"host": "<host>",
105+
"authenticationType": "Basic",
106+
"username": "<username>",
107+
"password": {
108+
"type": "SecureString",
109+
"value": "<password>"
110+
}
111+
},
112+
"connectVia": {
113+
"referenceName": "<name of Integration Runtime>",
114+
"type": "IntegrationRuntimeReference"
115+
}
116+
}
117+
}
118+
```
119+
120+
**Example: version 1.0**
94121

95122
```json
96123
{
@@ -153,12 +180,12 @@ For a full list of sections and properties available for defining activities, se
153180

154181
### Cassandra as source
155182

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:
183+
If you use version 2.0 (Preview) 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:
157184

158185
| Property | Description | Required |
159186
|:--- |:--- |:--- |
160187
| 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). |
188+
| 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). |No (if "tableName" and "keyspace" in dataset are specified). |
162189
| 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`) |
163190

164191
**Example:**
@@ -183,7 +210,8 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
183210
"typeProperties": {
184211
"source": {
185212
"type": "CassandraSource",
186-
"query": "select id, firstname, lastname from mykeyspace.mytable"
213+
"query": "select id, firstname, lastname from mykeyspace.mytable",
214+
"consistencyLevel": "one"
187215
},
188216
"sink": {
189217
"type": "<sink type>"
@@ -193,37 +221,45 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
193221
]
194222
```
195223

224+
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:
225+
226+
| Property | Description | Required |
227+
|:--- |:--- |:--- |
228+
| type | The type property of the copy activity source must be set to: **CassandraSource** | Yes |
229+
| 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). |
230+
| 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`) |
231+
196232
## Data type mapping for Cassandra
197233

198234
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.
199235

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 |
236+
| Cassandra data type | Interim service data type (for version 2.0) | Interim service data type (for version 1.0) |
237+
|:--- |:--- |:--- |
238+
| ASCII |String |String |
239+
| BIGINT |Int64 |Int64 |
240+
| BLOB |Byte[] |Byte[] |
241+
| BOOLEAN |Boolean |Boolean |
242+
| DECIMAL |Decimal |Decimal |
243+
| DOUBLE |Double |Double |
244+
| FLOAT |Single |Single |
245+
| INET |String |String |
246+
| INT |Int32 |Int32 |
247+
| TEXT |String |String |
248+
| TIMESTAMP |DateTime |DateTime |
249+
| TIMEUUID |Guid |Guid |
250+
| UUID |Guid |Guid |
251+
| VARCHAR |String |String |
252+
| VARINT |Decimal |Decimal |
217253

218254
> [!NOTE]
219-
> For collection types (map, set, list, etc.), refer to [Work with Cassandra collection types using virtual table](#work-with-collections-using-virtual-table) section.
255+
> For collection types (map, set, list, etc.) under version 1.0, refer to [Work with Cassandra collection types using virtual table when using version 1.0](#work-with-collections-using-virtual-table-when-using-version-10) section.
220256
>
221257
> User-defined types are not supported.
222258
>
223259
> The length of Binary Column and String Column lengths cannot be greater than 4000.
224260
>
225261
226-
## Work with collections using virtual table
262+
## Work with collections using virtual table when using version 1.0
227263

228264
The service uses a built-in ODBC driver to connect to and copy data from your Cassandra database. For collection types including map, set and list, the driver renormalizes the data into corresponding virtual tables. Specifically, if a table contains any collection columns, the driver generates the following virtual tables:
229265

@@ -288,5 +324,25 @@ The following tables show the virtual tables that renormalize the data from the
288324

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

327+
## Differences between Cassandra version 2.0 and version 1.0
328+
329+
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.
330+
331+
| version 2.0 | version 1.0 |
332+
| --- | --- |
333+
| Support CQL query. | Support SQL-92 query or CQL query. |
334+
| Support specifying `keyspace` and `tableName` separately in Cassandra dataset. | Support editing `keyspace` when you select enter manually table name in Cassandra dataset. |
335+
| There is no virtual tables for collection types. | For collection types (map, set, list, etc.), refer to [Work with Cassandra collection types using virtual table when using version 1.0](#work-with-collections-using-virtual-table-when-using-version-10) section. |
336+
337+
## Upgrade the Cassandra connector
338+
339+
Here are steps that help you upgrade the Cassandra connector:
340+
341+
1. In **Edit linked service** page, select **2.0 (Preview)** under **Version** and configure the linked service by referring to [Linked service properties](#linked-service-properties).
342+
343+
2. If you use `query` in the copy activity source for version 2.0, see [Cassandra as source](#cassandra-as-source).
344+
345+
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).
346+
291347
## Related content
292348
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)