You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/12 02:32:10 UTC

[GitHub] [pulsar] Anonymitaet commented on a diff in pull request #18008: [improve][io] JDBC Sink: add flag to exclude non declared fields

Anonymitaet commented on code in PR #18008:
URL: https://github.com/apache/pulsar/pull/18008#discussion_r992925241


##########
site2/docs/io-jdbc-sink.md:
##########
@@ -15,19 +15,20 @@ The configuration of all JDBC sink connectors has the following properties.
 
 ### Property
 
-| Name        | Type   | Required | Default            | Description                                                                                                              |
-|-------------|--------|----------|--------------------|--------------------------------------------------------------------------------------------------------------------------|
-| `userName`  | String | false    | " " (empty string) | The username used to connect to the database specified by `jdbcUrl`.<br /><br />**Note: `userName` is case-sensitive.**  |
-| `password`  | String | false    | " " (empty string) | The password used to connect to the database specified by `jdbcUrl`. <br /><br />**Note: `password` is case-sensitive.** |
-| `jdbcUrl`   | String | true     | " " (empty string) | The JDBC URL of the database that the connector connects to.                                                             |
-| `tableName` | String | true     | " " (empty string) | The name of the table that the connector writes to.                                                                      |
-| `nonKey`    | String | false    | " " (empty string) | A comma-separated list containing the fields used in updating events.                                                    |
-| `key`       | String | false    | " " (empty string) | A comma-separated list containing the fields used in `where` condition of updating and deleting events.                  |
-| `timeoutMs` | int    | false    | 500                | The JDBC operation timeout in milliseconds.                                                                              |
-| `batchSize` | int    | false    | 200                | The batch size of updates made to the database.                                                                          |
-| `insertMode` | enum( INSERT,UPSERT,UPDATE) | false    | INSERT | If it is configured as UPSERT, the sink uses upsert semantics rather than plain INSERT/UPDATE statements. Upsert semantics refer to atomically adding a new row or updating the existing row if there is a primary key constraint violation, which provides idempotence. |
-| `nullValueAction` | enum(FAIL, DELETE) | false    | FAIL | How to handle records with NULL values. Possible options are `DELETE` or `FAIL`. |
-| `useTransactions` | boolean | false    | true               | Enable transactions of the database.
+| Name        | Type   | Required | Default            | Description                                                                                                                                                                                                                                                                                                                  |
+|-------------|--------|----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `userName`  | String | false    | " " (empty string) | The username used to connect to the database specified by `jdbcUrl`.<br /><br />**Note: `userName` is case-sensitive.**                                                                                                                                                                                                      |
+| `password`  | String | false    | " " (empty string) | The password used to connect to the database specified by `jdbcUrl`. <br /><br />**Note: `password` is case-sensitive.**                                                                                                                                                                                                     |
+| `jdbcUrl`   | String | true     | " " (empty string) | The JDBC URL of the database that the connector connects to.                                                                                                                                                                                                                                                                 |
+| `tableName` | String | true     | " " (empty string) | The name of the table that the connector writes to.                                                                                                                                                                                                                                                                          |
+| `nonKey`    | String | false    | " " (empty string) | A comma-separated list containing the fields used in updating events.                                                                                                                                                                                                                                                        |
+| `key`       | String | false    | " " (empty string) | A comma-separated list containing the fields used in `where` condition of updating and deleting events.                                                                                                                                                                                                                      |
+| `timeoutMs` | int    | false    | 500                | The JDBC operation timeout in milliseconds.                                                                                                                                                                                                                                                                                  |
+| `batchSize` | int    | false    | 200                | The batch size of updates made to the database.                                                                                                                                                                                                                                                                              |
+| `insertMode` | enum( INSERT,UPSERT,UPDATE) | false    | INSERT             | If it is configured as UPSERT, the sink uses upsert semantics rather than plain INSERT/UPDATE statements. Upsert semantics refer to atomically adding a new row or updating the existing row if there is a primary key constraint violation, which provides idempotence.                                                     |
+| `nullValueAction` | enum(FAIL, DELETE) | false    | FAIL               | How to handle records with NULL values. Possible options are `DELETE` or `FAIL`.                                                                                                                                                                                                                                             |
+| `useTransactions` | boolean | false    | true               | Enable transactions of the database.                                                                                                                                                                                                                                                                                         
+| `excludeNonDeclaredFields` | boolean | false    | false              | All the table fields are discovered automatically. This fields indicate if the fields not explicitly listed in `nonKey` and `key` must be included in the query. By default all the fields of the table are included. In order to leverage of fields defaults during insertion, it is suggested to set this value to `false`. |

Review Comment:
   ```suggestion
   | `excludeNonDeclaredFields` | boolean | false    | false              | All the table fields are discovered automatically. These fields indicate if the fields are not explicitly listed in `nonKey` and `key`, they must be included in the query. By default, all the fields of the table are included. To leverage the default values of fields during insertion, it is suggested to set this value to `false`. |
   ```
   Do you mean this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org