NIFI-7410 Fix CLOB would be unreadable code in ExecuteSql or QueryDataBaseTable#4243
NIFI-7410 Fix CLOB would be unreadable code in ExecuteSql or QueryDataBaseTable#4243zhangchengk wants to merge 3 commits intoapache:masterfrom
Conversation
|
Is there a way to add a unit test for this? Maybe inserting Chinese characters into a Derby table with a CLOB column and reading the results? |
Thanks for reply. I will add a unit test for this situation. |
Hi @mattyb149 I have added one unit test.Clould you help me to check the PR of the |
|
Hey @mattyb149 - does it look good to you? |
|
Manually fixed the checkstyle violations and added the license to make the RAT check happy. Merging to main. Thanks @KuKuDeCheng (next time, please make sure to add the header and check the build with |
… convertToAvroStream method, use the DataTypeUtils.toString(clob/nClob,(String) null, StandardCharsets.UTF_8)) method to get the String NIFI-7410 Update JdbcCommon.java when javaSqlType is CLOB or NCLOB in convertToAvroStream method, use the CharacterStream rto read the value of CLOB NIFI-7410 Add a unit test. validate if it's unreadable when the clob value is Chinese, Japanese, and Korean. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes apache#4243.
… convertToAvroStream method, use the DataTypeUtils.toString(clob/nClob,(String) null, StandardCharsets.UTF_8)) method to get the String NIFI-7410 Update JdbcCommon.java when javaSqlType is CLOB or NCLOB in convertToAvroStream method, use the CharacterStream rto read the value of CLOB NIFI-7410 Add a unit test. validate if it's unreadable when the clob value is Chinese, Japanese, and Korean. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes apache#4243.
… convertToAvroStream method, use the DataTypeUtils.toString(clob/nClob,(String) null, StandardCharsets.UTF_8)) method to get the String NIFI-7410 Update JdbcCommon.java when javaSqlType is CLOB or NCLOB in convertToAvroStream method, use the CharacterStream rto read the value of CLOB NIFI-7410 Add a unit test. validate if it's unreadable when the clob value is Chinese, Japanese, and Korean. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes apache#4243.
… convertToAvroStream method, use the DataTypeUtils.toString(clob/nClob,(String) null, StandardCharsets.UTF_8)) method to get the String NIFI-7410 Update JdbcCommon.java when javaSqlType is CLOB or NCLOB in convertToAvroStream method, use the CharacterStream rto read the value of CLOB NIFI-7410 Add a unit test. validate if it's unreadable when the clob value is Chinese, Japanese, and Korean. Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes apache#4243.
https://issues.apache.org/jira/browse/NIFI-7410
Description of PR
fixes bug NIFI-7410
when ExecuteSql or QueryDataBaseTable processor trigger below code in JdbcCommon.java ,clob would be unreadable code(with Chinese character),because it used
InputStream is = clob.getAsciiStream();andrec.put(i - 1, new String(buffer));Update JdbcCommon.java when javaSqlType is CLOB or NCLOB in convertToAvroStream method, use the DataTypeUtils.toString(clob/nClob,(String) null, StandardCharsets.UTF_8)) method to get the String
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
[ √] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
[ √] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
[ √] Has your PR been rebased against the latest commit within the target branch (typically
master)?[√ ] Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squashor use--forcewhen pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean installat the rootnififolder?LICENSEfile, including the mainLICENSEfile undernifi-assembly?NOTICEfile, including the mainNOTICEfile found undernifi-assembly?.displayNamein addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.