DBZ-5807 update documentation to reflect Cassandra decimal.handling.mode configuration property

This commit is contained in:
Keri Harris 2022-11-10 20:04:24 +01:00 committed by Jiri Pechanec
parent 3c159ffab8
commit 5a41d96943
2 changed files with 55 additions and 0 deletions

View File

@ -237,6 +237,7 @@ Katerina Galieva
Kaushik Iyer
Kazuki MATSUDA / 松田一樹
Keith Barber
Keri Harris
Kevin Pullin
Kewei Shang
Krizhan Mariampillai

View File

@ -791,6 +791,50 @@ a|_n/a_
|===
=== Decimal types
The Cassandra connector handles `decimal` values according to the setting of the xref:{link-cassandra-connector}#cassandra-property-decimal-handling-mode[`decimal.handling.mode` connector configuration property].
decimal.handling.mode=double::
+
.Mapping when `decimal.handling.mode=double`
[cols="30%a,30%a,40%a",options="header",subs="+attributes"]
|===
|Cassandra type |Literal type |Semantic type
|`decimal`
|`FLOAT64`
a|_n/a_
|===
decimal.handling.mode=precise::
+
.Mappings when `decimal.handling.mode=precise`
[cols="30%a,15%a,55%a",options="header",subs="+attributes"]
|===
|Cassandra type |Literal type |Semantic type
|`decimal`
|`STRUCT`
a|`io.debezium.data.VariableScaleDecimal` +
Contains a structure with two fields: `scale` of type `INT32` that contains the scale of the transferred value and `value` of type `BYTES` containing the original value in an unscaled form.
|===
decimal.handling.mode=string::
+
.Mapping when `decimal.handling.mode=string`
[cols="30%a,30%a,40%a",options="header",subs="+attributes"]
|===
|Cassandra type |Literal type |Semantic type
|`decimal`
|`STRING`
a|_n/a_
|===
If the default data type conversions do not meet your needs, you can {link-prefix}:{link-custom-converters}#custom-converters[create a custom converter] for the connector.
[[cassandra-when-things-go-wrong]]
@ -1144,6 +1188,16 @@ For example, if the database server name or topic prefix is `fulfillment`, the d
+
`string` encodes values as formatted strings, which is easy to consume.
|[[cassandra-property-decimal-handling-mode]]<<cassandra-property-decimal-handling-mode, `decimal.handling.mode`>>
|`double`
|Specifies how `decimal` columns should be represented in change events. Possible settings are: +
+
`double` (the default) represents values by using Java's `double`, which might not offer the precision but which is easy to use in consumers. +
+
`precise` uses `java.math.BigDecimal` to represent values, which are encoded in the change events by using a binary representation and Kafka Connect's `org.apache.kafka.connect.data.VariableScaleDecimal` type. +
+
`string` encodes values as formatted strings, which is easy to consume.
|===
If the Cassandra agent use SSL to connect to Cassandra node, an SSL config file is required.