Compare commits

..

4 Commits

Author SHA1 Message Date
rlecomte-talend
087a4f79a8 TPS-3918 : MsSQL NVARCHAR Patch
Added PATCH_RELEASE_NOTE
2020-04-06 13:42:27 +02:00
rlecomte-talend
a4b5be8f1d TPS-3918 : MsSQL NVARCHAR Patch
Added PATCH_RELEASE_NOTE
2020-04-03 14:35:44 +02:00
Richard Lecomte
6b03649091 TDI-43764 : MsSQL NVARCHAR (#4518)
* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns only for MS driver

* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NTEXT columns only for MS driver
2020-04-03 11:41:58 +02:00
Richard Lecomte
968b1d9d20 TDI-43764 : MsSQL NVARCHAR (#4491)
* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns

* TDI-43764 : MsSQL NVARCHAR

Use setNString method for NVARCHAR and NCHAR columns
2020-04-03 11:41:47 +02:00
4 changed files with 44 additions and 36 deletions

View File

@@ -1,64 +1,52 @@
---
version: 7.2.1
module: https://talend.poolparty.biz/coretaxonomy/42
product: https://talend.poolparty.biz/coretaxonomy/17
product:
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-3600
# TPS-3918
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch\_20191206\_TPS-3600\_v2 |
| Release Date | 2019-12-06 |
| Target Version | 20190620\_1446-V7.2.1 |
| Patch Name | Patch\_20200403\_TPS-3918\_v1-7.2.1 |
| Release Date | 2020-04-30 |
| Target Version | 7.2.1.20190620_1446 |
| Product affected | Talend Studio |
## Introduction
## Introduction
This is a self-contained patch.
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
## Fixed issues
## Fixed issues <!-- mandatory -->
This patch contains the following fixes:
- TPS-3592 tBigQueryBulkExec loading data from Google Cloud Storage to BigQuery failed after setting header (TBD-9578)
- TPS-3600 tBigQueryBulkExec get error when run with big file (TBD-8853)
- TDI-43764 : MsSQL Output possible information loss when using UTF8 and NVARCHAR with MsSQL JDBC
## Prerequisites
Consider the following requirements for your system:
- Talend Studio 7.2.1 must be installed.
- Patch_20190923_TPS-3356_v3-7.2.1.zip must be installed.
## Installation
- From the Talend Studio 7.2.1 installation folder, make a copy of the following files somewhere safe:
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/templates/db_output_bulk.skeleton
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/tMSSqlConnection/tMSSqlConnection_begin.javajet
- Unzip content of the patch zip onto your Talend Studio 7.2.1 folder.
### Installing the patch using Software update
## Uninstallation
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
2) Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
3) On Studio Side: Logon Studio with remote mode, on the logon page the Update button is displayed: click this button to install the patch.
### Installing the patch using Talend Studio
1) Create a folder named "patches" under your studio installer directory and copy the patch .zip file to this folder.
2) Restart your studio: a window pops up, then click OK to install the patch, or restart the commandline and the patch will be installed automatically.
### Installing the patch using Commandline
Execute the following commands:
1. Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
2. initRemote {tac_url} -ul {TAC login username} -up {TAC login password}
3. checkAndUpdate -tu {TAC login username} -tup {TAC login password}
- Replace the files overriden by the patch by the copy you made before unzipping.
## Affected files for this patch
The following files are installed by this patch:
- plugins/org.talend.designer.components.localprovider/components/tBigQueryBulkExec/tBigQueryBulkExec_begin.javajet
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/templates/db_output_bulk.skeleton
- plugins/org.talend.designer.components.localprovider_7.2.1.20190620_1446/components/tMSSqlConnection/tMSSqlConnection_begin.javajet

View File

@@ -569,18 +569,17 @@
loadJobBuilder_<%=cid%>.setDestinationTable(tableId_<%=cid%>);
com.google.cloud.bigquery.CsvOptions.Builder csvOptions_<%=cid%> = com.google.cloud.bigquery.CsvOptions.newBuilder();
csvOptions_<%=cid%>.setAllowQuotedNewLines(true);
csvOptions_<%=cid%>.setSkipLeadingRows(<%=ElementParameterParser.getValue(node, "__GS_FILE_HEADER__")%>);
<%if("true".equals(ElementParameterParser.getValue(node, "__SET_FIELD_DELIMITER__"))) {
%>
csvOptions_<%=cid%>.setFieldDelimiter(<%=fieldDelimiter%>);
loadJobBuilder_<%=cid%>.setFormatOptions(csvOptions_<%=cid%>.setFieldDelimiter(<%=fieldDelimiter%>).build());
<%
}
%>
loadJobBuilder_<%=cid%>.setFormatOptions(csvOptions_<%=cid%>.build());
loadJobBuilder_<%=cid%>.setNullMarker("\\N");
com.google.cloud.bigquery.Job job_<%=cid%> = bigquery_<%=cid%>.create(com.google.cloud.bigquery.JobInfo.of(loadJobBuilder_<%=cid%>.build()));
job_<%=cid%> = job_<%=cid%>.waitFor(com.google.cloud.RetryOption.initialRetryDelay(org.threeten.bp.Duration.ofSeconds(1)));
job_<%=cid%> = job_<%=cid%>.waitFor(com.google.cloud.RetryOption.initialRetryDelay(org.threeten.bp.Duration.ofSeconds(1)), com.google.cloud.RetryOption.totalTimeout(org.threeten.bp.Duration.ofSeconds(30)));
if (job_<%=cid%> != null && job_<%=cid%>.getStatus().getError() == null) {
<%
if(isLog4jEnabled){

View File

@@ -69,3 +69,5 @@ imports="
globalMap.put("conn_<%=cid%>",conn_<%=cid%>);
globalMap.put("shareIdentitySetting_<%=cid%>", <%=ElementParameterParser.getValue(node, "__SHARE_IDENTITY_SETTING__")%>);
globalMap.put("driver_<%=cid%>", "<%=ElementParameterParser.getValue(node, "__DRIVER__")%>");

View File

@@ -2062,7 +2062,26 @@ public class CLASS {
setStmt.append(prefix + cid + ".setNull(" + index + dynamic + ", java.sql.Types.DATE);\r\n");
}
setStmt.append("}\r\n");
} else {
} else if("String".equals(typeToGenerate)) {
if ("NVARCHAR".equalsIgnoreCase(column.dataType) || "NCHAR".equalsIgnoreCase(column.dataType) || "NTEXT".equalsIgnoreCase(column.dataType)) {
boolean useExistingConnection = "true".equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
setStmt.append("String driver = null;\r\n");
if (useExistingConnection) {
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
setStmt.append("driver = ((String)globalMap.get(\"driver_" + connection + "\"));\r\n");
} else {
setStmt.append("driver = \"" + ElementParameterParser.getValue(node, "__DRIVER__") +"\";\r\n");
}
setStmt.append("if (\"MSSQL_PROP\".equals(driver)) {\r\n");
setStmt.append(prefix + cid + ".setNString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
setStmt.append("} else {\r\n");
setStmt.append(prefix + cid + ".setString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
setStmt.append("}\r\n");
} else {
setStmt.append(prefix + cid + ".setString(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
}
}else {
setStmt.append(prefix + cid + ".set" + typeToGenerate + "(" + index + dynamic + ", " + incomingConnName + "." + column.getName() + ");\r\n");
}
if(isObject) {