Skip to content

Commit 76cc7a2

Browse files
authored
Merge pull request #264055 from v-luckywang/0124-Update_adf_mariadb_v2
[New feature] - Update MariaDB V2 connector doc in ADF
2 parents bb40be3 + 36212a1 commit 76cc7a2

File tree

2 files changed

+117
-16
lines changed

2 files changed

+117
-16
lines changed

articles/data-factory/connector-mariadb.md

Lines changed: 117 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ ms.service: data-factory
77
ms.subservice: data-movement
88
ms.custom: synapse
99
ms.topic: conceptual
10-
ms.date: 01/05/2024
10+
ms.date: 01/18/2024
1111
ms.author: jianleishen
1212
---
13+
1314
# Copy data from MariaDB using Azure Data Factory or Synapse Analytics
1415
[!INCLUDE[appliesto-adf-asa-md](includes/appliesto-adf-asa-md.md)]
1516

@@ -30,7 +31,7 @@ For a list of data stores that are supported as sources/sinks by the copy activi
3031

3132
The service provides a built-in driver to enable connectivity, therefore you don't need to manually install any driver using this connector.
3233

33-
This connector currently supports MariaDB of version 10.0 to 10.5.
34+
This connector currently supports MariaDB of version 10.x, 11.x under the recommended new driver version v2 and 10.0 to 10.5 for the legacy driver version.
3435

3536
## Prerequisites
3637

@@ -56,8 +57,7 @@ Use the following steps to create a linked service to MariaDB in the Azure porta
5657

5758
2. Search for Maria and select the MariaDB connector.
5859

59-
:::image type="content" source="media/connector-mariadb/mariadb-connector.png" alt-text="Screenshot of the MariaDB connector.":::
60-
60+
:::image type="content" source="media/connector-mariadb/mariadb-connector.png" alt-text="Screenshot of the MariaDB connector.":::
6161

6262
1. Configure the service details, test the connection, and create the new linked service.
6363

@@ -69,12 +69,17 @@ The following sections provide details about properties that are used to define
6969

7070
## Linked service properties
7171

72-
The following properties are supported for MariaDB linked service:
72+
If you use the recommended driver version, the following properties are supported for MariaDB linked service:
7373

7474
| Property | Description | Required |
7575
|:--- |:--- |:--- |
7676
| type | The type property must be set to: **MariaDB** | Yes |
77-
| connectionString | An ODBC connection string to connect to MariaDB. <br/>You can also put password in Azure Key Vault and pull the `pwd` configuration out of the connection string. Refer to the following samples and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) article with more details. | Yes |
77+
| driverVersion | The driver version when you select the recommended driver version. The value is v2. | Yes |
78+
| server | The name of your MariaDB Server. | Yes |
79+
| port | The port number to connect to the MariaDB server. | No |
80+
| database | Your MariaDB database name. | Yes |
81+
| username | Your user name. | Yes |
82+
| password | The password for the user name. Mark this field as SecureString to store it securely. Or, you can [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | Yes |
7883
| connectVia | The [Integration Runtime](concepts-integration-runtime.md) to be used to connect to the data store. Learn more from [Prerequisites](#prerequisites) section. If not specified, it uses the default Azure Integration Runtime. |No |
7984

8085
**Example:**
@@ -85,7 +90,15 @@ The following properties are supported for MariaDB linked service:
8590
"properties": {
8691
"type": "MariaDB",
8792
"typeProperties": {
88-
"connectionString": "Server=<host>;Port=<port>;Database=<database>;UID=<user name>;PWD=<password>"
93+
"server": "<server>",
94+
"port": "<port>",
95+
"database": "<database>",
96+
"username": "<username>",
97+
"password": {
98+
"type": "SecureString",
99+
"value": "<password>"
100+
},
101+
"driverVersion": "v2"
89102
},
90103
"connectVia": {
91104
"referenceName": "<name of Integration Runtime>",
@@ -103,15 +116,45 @@ The following properties are supported for MariaDB linked service:
103116
"properties": {
104117
"type": "MariaDB",
105118
"typeProperties": {
106-
"connectionString": "Server=<host>;Port=<port>;Database=<database>;UID=<user name>;",
107-
"pwd": { 
108-
"type": "AzureKeyVaultSecret", 
109-
"store": { 
110-
"referenceName": "<Azure Key Vault linked service name>", 
111-
"type": "LinkedServiceReference" 
112-
}, 
113-
"secretName": "<secretName>" 
114-
}
119+
"server": "<server>",
120+
"port": "<port>",
121+
"database": "<database>",
122+
"username": "<username>",
123+
"password": {
124+
"type": "AzureKeyVaultSecret",
125+
"store": {
126+
"referenceName": "<Azure Key Vault linked service name>",
127+
"type": "LinkedServiceReference"
128+
},
129+
"secretName": "<secretName>"
130+
},
131+
"driverVersion": "v2"
132+
},
133+
"connectVia": {
134+
"referenceName": "<name of Integration Runtime>",
135+
"type": "IntegrationRuntimeReference"
136+
}
137+
}
138+
}
139+
```
140+
141+
If you use the legacy driver version, the following properties are supported:
142+
143+
| Property | Description | Required |
144+
|:--- |:--- |:--- |
145+
| type | The type property must be set to: **MariaDB** | Yes |
146+
| connectionString | An ODBC connection string to connect to MariaDB. <br/>You can also put password in Azure Key Vault and pull the `pwd` configuration out of the connection string. Refer to the following samples and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) article with more details. | Yes |
147+
| connectVia | The [Integration Runtime](concepts-integration-runtime.md) to be used to connect to the data store. Learn more from [Prerequisites](#prerequisites) section. If not specified, it uses the default Azure Integration Runtime. |No |
148+
149+
**Example:**
150+
151+
```json
152+
{
153+
"name": "MariaDBLinkedService",
154+
"properties": {
155+
"type": "MariaDB",
156+
"typeProperties": {
157+
"connectionString": "Server=<host>;Port=<port>;Database=<database>;UID=<user name>;PWD=<password>"
115158
},
116159
"connectVia": {
117160
"referenceName": "<name of Integration Runtime>",
@@ -189,10 +232,68 @@ To copy data from MariaDB, set the source type in the copy activity to **MariaDB
189232
]
190233
```
191234

235+
## Data type mapping for MariaDB
236+
237+
When copying data from MariaDB, the following mappings are used from MariaDB data types to interim data types used by the service internally. 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.
238+
239+
| MariaDB data type | Interim service data type | Interim service data type (for the legacy driver version) |
240+
|:--- |:--- |:--- |
241+
| `bigint` |`Int64` |`Int64` |
242+
| `bigint unsigned` |`Decimal` |`Decimal` |
243+
| `bit(1)` |`UInt64` |`Boolean` |
244+
| `bit(M), M>1`|`UInt64`|`Byte[]`|
245+
| `blob` |`Byte[]` |`Byte[]` |
246+
| `bool` |`Boolean` <br/>(If TreatTinyAsBoolean=false, it is mapped as `SByte`. TreatTinyAsBoolean is true by default ) |`Int16` |
247+
| `char` |`String` |`String` |
248+
| `date` |`Datetime` |`Datetime` |
249+
| `datetime` |`Datetime` |`Datetime` |
250+
| `decimal` |`Decimal` |`Decimal, String` |
251+
| `double` |`Double` |`Double` |
252+
| `double precision` |`Double` |`Double` |
253+
| `enum` |`String` |`String` |
254+
| `float` |`Single` |`Single` |
255+
| `int` |`Int32` |`Int32` |
256+
| `int unsigned` |`Int64`|`Int64`|
257+
| `integer` |`Int32` |`Int32` |
258+
| `integer unsigned` |`Int64` |`Int64` |
259+
| `JSON` |`String` |-|
260+
| `long varbinary` |`Byte[]` |`Byte[]` |
261+
| `long varchar` |`String` |`String` |
262+
| `longblob` |`Byte[]` |`Byte[]` |
263+
| `longtext` |`String` |`String` |
264+
| `mediumblob` |`Byte[]` |`Byte[]` |
265+
| `mediumint` |`Int32` |`Int32` |
266+
| `mediumint unsigned` |`Int64` |`Int64` |
267+
| `mediumtext` |`String` |`String` |
268+
| `numeric` |`Decimal` |`Decimal` |
269+
| `real` |`Double` |`Double` |
270+
| `set` |`String` |`String` |
271+
| `smallint` |`Int16` |`Int16` |
272+
| `smallint unsigned` |`Int32` |`Int32` |
273+
| `text` |`String` |`String` |
274+
| `time` |`TimeSpan` |`TimeSpan` |
275+
| `timestamp` |`Datetime` |`Datetime` |
276+
| `tinyblob` |`Byte[]` |`Byte[]` |
277+
| `tinyint` |`SByte` |`Int16` |
278+
| `tinyint unsigned` |`Int16` |`Int16` |
279+
| `tinytext` |`String` |`String` |
280+
| `varchar` |`String` |`String` |
281+
| `year` |`Int` |`Int` |
282+
192283
## Lookup activity properties
193284

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

287+
## Upgrade the MariaDB driver version
288+
289+
Here are steps that help you upgrade your MariaDB driver version:
290+
291+
1. Create a new MariaDB linked service and configure it by referring to [Linked service properties](connector-mariadb.md#linked-service-properties).
292+
293+
1. The data type mapping for the latest MariaDB linked service is different from that for the legacy version. To learn the latest data type mapping, see [Data type mapping for MariaDB](connector-mariadb.md#data-type-mapping-for-mariadb).
294+
295+
1. More MariaDB versions are supported for the latest driver version. For more information, see [Supported capabilities](connector-mariadb.md#supported-capabilities).
196296

197297
## Related content
298+
198299
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).
-1.83 KB
Loading

0 commit comments

Comments
 (0)