Skip to content

Commit 7fba79e

Browse files
committed
Update
1 parent 45a09fd commit 7fba79e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

articles/data-factory/connector-cassandra.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,17 @@ When copying data from Cassandra, the following mappings are used from Cassandra
239239
| BIGINT |Int64 |Int64 |
240240
| BLOB |Byte[] |Byte[] |
241241
| BOOLEAN |Boolean |Boolean |
242+
| DATE | IDate | 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 |
@@ -261,7 +264,23 @@ When copying data from Cassandra, the following mappings are used from Cassandra
261264
262265
## Work with collections using original type when using version 2.0
263266

264-
For collection types including map, set and list, the data are represented in Json format. There are no virtual tables for collection types, and instead copying a source table to sink in its original type.
267+
There are no virtual tables for collection types, you can copy a source table to sink in its original type.
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+
No need to create any virtual tables. You can directly read data from a source table and treat complex type column values as its original type, as shown 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"] |
265284

266285
## Work with collections using virtual table when using version 1.0
267286

@@ -336,7 +355,8 @@ The Cassandra connector version 2.0 offers new functionalities and is compatible
336355
| --- | --- |
337356
| Support CQL query. | Support SQL-92 query or CQL query. |
338357
| Support specifying `keyspace` and `tableName` separately in dataset. | Support editing `keyspace` when you select enter manually table name in dataset. |
339-
| For collection types (map, set, list, etc.), there are no virtual tables for collection types. You can copy a source table to sink in its original type, refer to [Work with collections using original type when using version 2.0](#work-with-collections-using-original-type-when-using-version-20) section. | 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. |
358+
| There are no virtual tables for collection types, refer to [Work with collections using original type when using version 2.0](#work-with-collections-using-original-type-when-using-version-20) section. | For collection types, 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. |
359+
| The following mappings are used from Cassandra data types to interim service data type. <br><br> DATE -> IDate <br> SMALLINT -> Short <br> TINYINT -> SByte | The following mappings are used from Cassandra data types to interim service data type. <br><br> DATE -> DateTime <br> SMALLINT -> Int16 <br> TINYINT -> Int16 |
340360

341361
## Upgrade the Cassandra connector
342362

@@ -346,5 +366,7 @@ Here are steps that help you upgrade the Cassandra connector:
346366

347367
2. If you use `query` in the copy activity source for version 2.0, see [Cassandra as source](#cassandra-as-source).
348368

369+
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).
370+
349371
## Related content
350372
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)