You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/data-factory/connector-cassandra.md
+81-25Lines changed: 81 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: jianleishen
6
6
ms.subservice: data-movement
7
7
ms.custom: synapse
8
8
ms.topic: conceptual
9
-
ms.date: 10/20/2023
9
+
ms.date: 02/28/2025
10
10
ms.author: jianleishen
11
11
---
12
12
# 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
30
30
31
31
Specifically, this Cassandra connector supports:
32
32
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.
34
35
- Copying data using **Basic** or **Anonymous** authentication.
35
36
36
37
>[!NOTE]
@@ -80,6 +81,7 @@ The following properties are supported for Cassandra linked service:
80
81
| Property | Description | Required |
81
82
|:--- |:--- |:--- |
82
83
| 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. |
83
85
| 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 |
84
86
| port |The TCP port that the Cassandra server uses to listen for client connections. |No (default is 9042) |
85
87
| 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:
90
92
>[!NOTE]
91
93
>Currently connection to Cassandra using TLS is not supported.
92
94
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**
94
121
95
122
```json
96
123
{
@@ -153,12 +180,12 @@ For a full list of sections and properties available for defining activities, se
153
180
154
181
### Cassandra as source
155
182
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:
157
184
158
185
| Property | Description | Required |
159
186
|:--- |:--- |:--- |
160
187
| 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). |
162
189
| 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`) |
163
190
164
191
**Example:**
@@ -183,7 +210,8 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
183
210
"typeProperties": {
184
211
"source": {
185
212
"type": "CassandraSource",
186
-
"query": "select id, firstname, lastname from mykeyspace.mytable"
213
+
"query": "select id, firstname, lastname from mykeyspace.mytable",
214
+
"consistencyLevel": "one"
187
215
},
188
216
"sink": {
189
217
"type": "<sink type>"
@@ -193,37 +221,45 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
193
221
]
194
222
```
195
223
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
+
196
232
## Data type mapping for Cassandra
197
233
198
234
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.
199
235
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 |
217
253
218
254
> [!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.
220
256
>
221
257
> User-defined types are not supported.
222
258
>
223
259
> The length of Binary Column and String Column lengths cannot be greater than 4000.
224
260
>
225
261
226
-
## Work with collections using virtual table
262
+
## Work with collections using virtual table when using version 1.0
227
263
228
264
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:
229
265
@@ -288,5 +324,25 @@ The following tables show the virtual tables that renormalize the data from the
288
324
289
325
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
290
326
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
+
291
347
## Related content
292
348
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).
0 commit comments