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
+79-21Lines changed: 79 additions & 21 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
@@ -80,6 +80,7 @@ The following properties are supported for Cassandra linked service:
80
80
| Property | Description | Required |
81
81
|:--- |:--- |:--- |
82
82
| 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 |
83
84
| 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
85
| port |The TCP port that the Cassandra server uses to listen for client connections. |No (default is 9042) |
85
86
| 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:
90
91
>[!NOTE]
91
92
>Currently connection to Cassandra using TLS is not supported.
92
93
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**
94
120
95
121
```json
96
122
{
@@ -153,12 +179,12 @@ For a full list of sections and properties available for defining activities, se
153
179
154
180
### Cassandra as source
155
181
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:
157
183
158
184
| Property | Description | Required |
159
185
|:--- |:--- |:--- |
160
186
| 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). |
162
188
| 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
189
164
190
**Example:**
@@ -193,27 +219,40 @@ To copy data from Cassandra, set the source type in the copy activity to **Cassa
193
219
]
194
220
```
195
221
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
+
196
230
## Data type mapping for Cassandra
197
231
198
232
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
233
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 |
217
256
218
257
> [!NOTE]
219
258
> 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
288
327
289
328
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
290
329
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
+
291
349
## Related content
292
350
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