Skip to content

Commit ec100d2

Browse files
Merge pull request #295934 from Lucky-Wang16/0307-Update_Cassandra_diff
Update Cassandra V2 complex type difference
2 parents 1801f09 + 228ab90 commit ec100d2

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

articles/data-factory/connector-cassandra.md

Lines changed: 36 additions & 12 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: 02/28/2025
9+
ms.date: 03/07/2025
1010
ms.author: jianleishen
1111
---
1212
# Copy data from Cassandra using Azure Data Factory or Synapse Analytics
@@ -30,7 +30,7 @@ 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 3.x.x and 4.x.x** for version 2.0.
33+
- Cassandra **versions 3.x.x and 4.x.x** for version 2.0 (Preview).
3434
- Cassandra **versions 2.x and 3.x** for version 1.0.
3535
- Copying data using **Basic** or **Anonymous** authentication.
3636

@@ -81,7 +81,7 @@ The following properties are supported for Cassandra linked service:
8181
| Property | Description | Required |
8282
|:--- |:--- |:--- |
8383
| 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. |
84+
| version | The version that you specify. The value is `2.0`. | Yes for version 2.0 (Preview), not supported for version 1.0. |
8585
| 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 |
8686
| port |The TCP port that the Cassandra server uses to listen for client connections. |No (default is 9042) |
8787
| authenticationType | Type of authentication used to connect to the Cassandra database.<br/>Allowed values are: **Basic**, and **Anonymous**. |Yes |
@@ -233,20 +233,23 @@ If you use version 1.0 to copy data from Cassandra, set the source type in the c
233233

234234
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.
235235

236-
| Cassandra data type | Interim service data type (for version 2.0) | Interim service data type (for version 1.0) |
236+
| Cassandra data type | Interim service data type (for version 2.0 (Preview)) | Interim service data type (for version 1.0) |
237237
|:--- |:--- |:--- |
238238
| ASCII |String |String |
239239
| BIGINT |Int64 |Int64 |
240240
| BLOB |Byte[] |Byte[] |
241241
| BOOLEAN |Boolean |Boolean |
242+
| DATE | DateTime | DateTime |
242243
| DECIMAL |Decimal |Decimal |
243244
| DOUBLE |Double |Double |
244245
| FLOAT |Single |Single |
245246
| INET |String |String |
246247
| INT |Int32 |Int32 |
248+
| SMALLINT | Short | Int16 |
247249
| TEXT |String |String |
248250
| TIMESTAMP |DateTime |DateTime |
249251
| TIMEUUID |Guid |Guid |
252+
| TINYINT | SByte | Int16 |
250253
| UUID |Guid |Guid |
251254
| VARCHAR |String |String |
252255
| VARINT |Decimal |Decimal |
@@ -259,6 +262,26 @@ When copying data from Cassandra, the following mappings are used from Cassandra
259262
> The length of Binary Column and String Column lengths cannot be greater than 4000.
260263
>
261264
265+
## Work with collections when using version 2.0 (Preview)
266+
267+
When using version 2.0 (Preview) to copy data from your Cassandra database, no virtual tables for collection types are created. You can copy a source table to the sink in its original type in JSON format.
268+
269+
### Example
270+
271+
For example, the following "ExampleTable" is a Cassandra database table that contains an integer primary key column named "pk_int", a text column named value, a list column, a map column, and a set column (named "StringSet").
272+
273+
| pk_int | Value | List | Map | StringSet |
274+
| --- | --- | --- | --- | --- |
275+
| 1 |"sample value 1" |["1", "2", "3"] |{"S1": "a", "S2": "b"} |{"A", "B", "C"} |
276+
| 3 |"sample value 3" |["100", "101", "102", "105"] |{"S1": "t"} |{"A", "E"} |
277+
278+
The data can be directly read from a source table, and the column values are preserved in their original types in JSON format, as illustrated in the following table:
279+
280+
| pk_int | Value | List | Map | StringSet |
281+
| --- | --- | --- | --- | --- |
282+
| 1 |"sample value 1" |["1", "2", "3"] |{"S1": "a", "S2": "b"} |["A", "B", "C"] |
283+
| 3 |"sample value 3" |["100", "101", "102", "105"] |{"S1": "t"} |["A", "E"] |
284+
262285
## Work with collections using virtual table when using version 1.0
263286

264287
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:
@@ -324,25 +347,26 @@ The following tables show the virtual tables that renormalize the data from the
324347

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

327-
## Differences between Cassandra version 2.0 and version 1.0
350+
## Differences between Cassandra version 2.0 (Preview) and version 1.0
328351

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.
352+
The Cassandra connector version 2.0 (Preview) offers new functionalities and is compatible with most features of version 1.0. The table below shows the feature differences between version 2.0 (Preview) and version 1.0.
330353

331-
| version 2.0 | version 1.0 |
354+
| Version 2.0 (Preview) | Version 1.0 |
332355
| --- | --- |
333356
| 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. |
357+
| Support specifying `keyspace` and `tableName` separately in dataset. | Support editing `keyspace` when you select enter manually table name in dataset. |
358+
| No virtual tables are created for collection types. For more information, see [Work with collections when using version 2.0 (Preview)](#work-with-collections-when-using-version-20-preview). | Virtual tables are created for collection types. For more information, see [Work with Cassandra collection types using virtual table when using version 1.0](#work-with-collections-using-virtual-table-when-using-version-10). |
359+
| The following mappings are used from Cassandra data types to interim service data type. <br><br> SMALLINT -> Short <br> TINYINT -> SByte | The following mappings are used from Cassandra data types to interim service data type. <br><br> SMALLINT -> Int16 <br> TINYINT -> Int16 |
336360

337361
## Upgrade the Cassandra connector
338362

339363
Here are steps that help you upgrade the Cassandra connector:
340364

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).
365+
1. In **Edit linked service** page, select version 2.0 (Preview) and configure the linked service by referring to [Linked service properties](#linked-service-properties).
342366

343-
2. If you use `query` in the copy activity source for version 2.0, see [Cassandra as source](#cassandra-as-source).
367+
2. In version 2.0 (Preview), the `query` in the copy activity source supports only CQL query, not SQL-92 query. For more information, see [Cassandra as source](#cassandra-as-source).
344368

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).
369+
3. The data type mapping for version 2.0 (Preview) 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).
346370

347371
## Related content
348372
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

Comments
 (0)