Merge branch 'maintenance/8.0' of https://github.com/Talend/tdi-studio-se into dsylaiev/TDI-47168_temp_branc_8.0

This commit is contained in:
Dmytro Sylaiev
2022-04-20 16:07:33 +03:00
88 changed files with 1608 additions and 883 deletions

View File

@@ -10,7 +10,7 @@ CodeGenerator.getGraphicalNode2=------process.getGeneratingNodes()------
CodeGenerator.JET.TimeOut=JET\u306E\u521D\u671F\u5316\u51E6\u7406\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F
CodeGenerator.newLine=\n\n\n\n
CodeGenerator.Node.NotFound=\u73FE\u5728\u306E\u30D7\u30ED\u30BB\u30B9\u306B\u30CE\u30FC\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
CodeGenerator.Component.NotFound=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059: {0}\u3002Studio\u3067 -D{1}=false\u3092\u4F7F\u3046\u3068\u3053\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u3001\u8B66\u544A\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u30ED\u30B0\u30D5\u30A1\u30A4\u30EB\u306B\u8A18\u9332\u3055\u308C\u307E\u3059\u3002
CodeGenerator.Components.NotFound={0}: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059: {1}\u3002Studio\u3067 -D{2}=false\u3092\u4F7F\u3046\u3068\u3053\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u3001\u8B66\u544A\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u30ED\u30B0\u30D5\u30A1\u30A4\u30EB\u306B\u8A18\u9332\u3055\u308C\u307E\u3059\u3002
JavaRoutineSynchronizer.UnsupportedOperation.Exception1=\u30E1\u30BD\u30C3\u30C9\u304C\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093\\: org.talend.designer.codegen.JavaRoutineSynchronizer line\\:49
JavaRoutineSynchronizer.UnsupportedOperation.Exception2=\u30E1\u30BD\u30C3\u30C9\u304C\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093\\: org.talend.designer.codegen.JavaRoutineSynchronizer line\\:58
JetSkeletonManager.unableLoad=\u30B9\u30B1\u30EB\u30C8\u30F3\u66F4\u65B0\u30AD\u30E3\u30C3\u30B7\u30E5\u30D5\u30A1\u30A4\u30EB\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093

View File

@@ -10,7 +10,7 @@ CodeGenerator.getGraphicalNode2=\u8FDB\u7A0B\u5F97\u5230\u751F\u6210\u8282\u70B9
CodeGenerator.JET.TimeOut=JET \u521D\u59CB\u5316\u8D85\u65F6
CodeGenerator.newLine=\n\n\n\n
CodeGenerator.Node.NotFound=\u5728\u5F53\u524D
CodeGenerator.Component.NotFound=\u7EC4\u4EF6\u7F3A\u5931: {0}; \u5728 Studio \u6216\u547D\u4EE4\u884C\u4E2D\u4F7F\u7528 -D{1}=false \u53EF\u8DF3\u8FC7\u6B64\u9879\u68C0\u67E5\uFF0C\u540C\u65F6\u89E6\u53D1\u8B66\u544A\u6D88\u606F\u3002
CodeGenerator.Components.NotFound={0}: \u7EC4\u4EF6\u7F3A\u5931: {1}; \u5728 Studio \u6216\u547D\u4EE4\u884C\u4E2D\u4F7F\u7528 -D{2}=false \u53EF\u8DF3\u8FC7\u6B64\u9879\u68C0\u67E5\uFF0C\u540C\u65F6\u89E6\u53D1\u8B66\u544A\u6D88\u606F\u3002
JavaRoutineSynchronizer.UnsupportedOperation.Exception1=\u65B9\u6CD5\u672A\u5B9E\u65BD\uFF1Aorg.talend.designer.codegen.JavaRoutineSynchronizer line:49
JavaRoutineSynchronizer.UnsupportedOperation.Exception2=\u65B9\u6CD5\u672A\u5B9E\u65BD\uFF1Aorg.talend.designer.codegen.JavaRoutineSynchronizer line:58
JetSkeletonManager.unableLoad=\u65E0\u6CD5\u52A0\u8F7D\u4E3B\u5E72\u66F4\u65B0\u7F13\u5B58\u6587\u4EF6

View File

@@ -257,6 +257,18 @@
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="REDSHIFT_DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="50"
SHOW_IF="(DBTYPE=='REDSHIFT' and USE_EXISTING_CONNECTION=='FALSE')"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="CONNECTION_AS400"
FIELD="COMPONENT_LIST"
@@ -758,12 +770,32 @@
FIELD="TEXT"
NUM_ROW="10"
REPOSITORY_VALUE="PROPERTIES_STRING"
NOT_SHOW_IF="(DBTYPE=='SQLITE') OR ((DBTYPE=='DBORACLE') AND (CONNECTION_TYPE == 'ORACLE_WALLET')) OR USE_EXISTING_CONNECTION == 'true'"
NOT_SHOW_IF="(DBTYPE=='SQLITE') OR ((DBTYPE=='DBORACLE') AND (CONNECTION_TYPE == 'ORACLE_WALLET')) OR ((DBTYPE=='REDSHIFT') AND (USE_STRING_PROPERTIES == 'false') AND (REDSHIFT_DRIVER_VERSION == 'DRIVER_V2')) OR USE_EXISTING_CONNECTION == 'true'"
>
<DEFAULT IF="((DBTYPE!='AS400') AND (DBTYPE!='MSSQL'))">""</DEFAULT>
<DEFAULT IF="(DBTYPE=='AS400') OR (DBTYPE=='MSSQL')">"prompt=false"</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='REDSHIFT') AND (REDSHIFT_DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="5"
REQUIRED="true"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='REDSHIFT') AND (USE_STRING_PROPERTIES == 'false') AND (REDSHIFT_DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="10" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="MSSQL_ACTIVE_DIR_AUTH" FIELD="CHECK" NUM_ROW="12" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='MSSQL') AND (MSSQL_DRIVER=='MSSQL_PROP')">
<DEFAULT>false</DEFAULT>
</PARAMETER>
@@ -854,12 +886,12 @@
<IMPORT NAME="Driver-SYBASE-JCONN3" MODULE="jconn3.jar" MVN="mvn:org.talend.libraries/jconn3/6.0.0" BundleID="" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='SYBASE') AND (DB_SYBASE_VERSION == 'SYBSEIQ_12_15')" />
<IMPORT NAME="Driver-SYBASE-JCONN4" MODULE="jconn4.jar" MVN="mvn:org.talend.libraries/jconn4/6.0.0" BundleID="" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='SYBASE') AND (DB_SYBASE_VERSION == 'SYBSEIQ_16')" />
<IMPORT NAME="Driver-SqlAnywhere" MODULE="sajdbc4.jar" MVN="mvn:sap.jdbc4.sqlanywhere/sajdbc4/17.0.0" BundleID="" REQUIRED_IF = "(DB_VERSION == 'SYBSEIQ_16_SA') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Teradata_jdbc" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='TERADATA')" />
<IMPORT NAME="Driver-Teradata_config" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='TERADATA')" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='TERADATA')" />
<IMPORT NAME="Driver-Netezza" MODULE="nzjdbc.jar" MVN="mvn:org.talend.libraries/nzjdbc/6.0.0" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='NETEZZA')" />
<IMPORT NAME="Driver-EXASolution" MODULE="exajdbc-6.0.9302.jar" MVN="mvn:org.talend.libraries/exajdbc-6.0.9302/6.3.0" REQUIRED_IF="(DBTYPE=='EXASOL') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED_IF="(DBTYPE=='REDSHIFT') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Redshift-v2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3" REQUIRED_IF="(DBTYPE=='REDSHIFT') AND (USE_EXISTING_CONNECTION == 'false') AND (REDSHIFT_DRIVER_VERSION == 'DRIVER_V2')" />
<IMPORT NAME="Driver-Redshift-v1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED_IF="(DBTYPE=='REDSHIFT') and (USE_EXISTING_CONNECTION == 'false') AND (REDSHIFT_DRIVER_VERSION == 'DRIVER_V1')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED_IF="(DBTYPE=='REDSHIFT') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-Snowflake" MODULE="snowflake-jdbc-3.13.14.jar" MVN="mvn:net.snowflake/snowflake-jdbc/3.13.14" REQUIRED_IF="(DBTYPE=='SNOWFLAKE') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="Driver-VERTICA_9.0" MODULE="vertica-jdbc-9.3.1-0.jar" MVN="mvn:com.vertica/vertica-jdbc/9.3.1-0" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_9_0')"/>

View File

@@ -1997,12 +1997,51 @@ class RedshiftManager extends Manager {
public String getSpecificConnectionURL() {
return "\"jdbc:redshift://\" + " + host + " + \":\" + " + port + " + \"/\" + " + dbName;
}
public String getConnectionURL(){
boolean useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
int driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__REDSHIFT_DRIVER_VERSION__"))? 2 : 1;
if (getAdditionalParams() == null || "\"\"".equals(getAdditionalParams().trim()) || (!useStringProperties && driveVersion == 2) ){
return getSpecificConnectionURL();
}else{
return getSpecificConnectionURL() + " + \"" + getSeparator() + "\" + " + getAdditionalParams();
}
}
public String getConnection() {
boolean useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
int driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__REDSHIFT_DRIVER_VERSION__"))? 2 : 1;
StringBuilder javaCode = new StringBuilder();
if(useExistingConnection) {
javaCode.append(retrieveTable());
javaCode.append("java.sql.Connection conn_" + cid + " = (java.sql.Connection)globalMap.get(\"conn_" + connection + "\");");
} else {
} else if(!useStringProperties && driveVersion == 2){
javaCode.append(retrieveTable());
javaCode.append("java.lang.Class jdbcclazz_" + cid + "= java.lang.Class.forName(\"" + getDriver()+ "\");\r\n");
newInstance(javaCode);
log4jCodeGenerateUtil.connect_begin();
String passwordFieldName = "__PASS__";
if(ElementParameterParser.canEncrypt(node, passwordFieldName)) {
javaCode.append("final String decryptedPassword_" + cid + "= routines.system.PasswordEncryptUtil.decryptPassword(" + ElementParameterParser.getEncryptedValue(node, passwordFieldName) + ");\r\n");
} else {
javaCode.append("final String decryptedPassword_" + cid + "= " + ElementParameterParser.getValue(node, passwordFieldName) + ";\r\n");
}
java.util.List<java.util.Map<String, String>> properties = (java.util.List<java.util.Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
javaCode.append("java.util.Properties atnParamsPrope_" + cid + "= new java.util.Properties();\r\n");
javaCode.append("atnParamsPrope_" + cid + ".put(\"user\",dbUser_"+ cid + ");\r\n");
javaCode.append("atnParamsPrope_" + cid + ".put(\"password\",decryptedPassword_" + cid + ");\r\n");
for(java.util.Map<String, String> entry : properties){
javaCode.append("atnParamsPrope_" + cid + ".put(" + entry.get("KEY") + "," + entry.get("VALUE") + ");\r\n");
}
javaCode.append("java.sql.Connection conn_" + cid + " = java.sql.DriverManager.getConnection(url_" + cid + ", atnParamsPrope_" + cid + ");\r\n");
}else {
javaCode.append(super.getConnection());
}
return javaCode.toString();
@@ -2690,10 +2729,13 @@ if(columnList != null && columnList.size() > 0) {
<%
}
}
log4jCodeGenerateUtil.close_begin();
if(!useExistingConnection){
log4jCodeGenerateUtil.close_begin();
%>
<%=manager.closeConnection()%>
<%log4jCodeGenerateUtil.close_end();
}
%>
<%=manager.closeConnection()%>
<%log4jCodeGenerateUtil.close_end();%>
globalMap.put("<%=cid%>_QUERY", "<%=manager.getCreateTableSQL(columnList)%>");
} catch(java.lang.Exception e) {
globalMap.put("<%=cid%>_ERROR_MESSAGE",e.getMessage());

View File

@@ -137,3 +137,12 @@ ACCOUNT.NAME=Account
ROLE.NAME=Role
ENFORCE_DELIMITED_IDENTIFIERS.NAME=Enforce database delimited identifiers
UNLOGGED.NAME=Unlogged Table
REDSHIFT_DRIVER_VERSION.NAME=Driver version
REDSHIFT_DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
REDSHIFT_DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -13,7 +13,7 @@ imports="
java.util.List
java.util.ArrayList
java.util.LinkedList
java.util.StringJoiner
java.util.StringJoiner
java.util.Map
java.util.HashMap
"
@@ -80,6 +80,7 @@ skeleton="../templates/db_output_bulk.skeleton"
String dbuser = null;
boolean useExistingConn = false;
boolean dryRun = false;
boolean autoWrapColumnName = false;
if(previousNode != null) {
dryRun = ("true").equals(ElementParameterParser.getValue(previousNode, "__DRY_RUN__"));
if(!dryRun){
@@ -88,6 +89,7 @@ skeleton="../templates/db_output_bulk.skeleton"
dbuser = ElementParameterParser.getValue(previousNode, "__USER__");
useExistingConn = ("true").equals(ElementParameterParser.getValue(previousNode, "__USE_EXISTING_CONNECTION__"));
}
autoWrapColumnName = "true".equals(ElementParameterParser.getValue(previousNode, "__ACTIVE_DATABASE_DELIMITED_IDENTIFIERS__"));
}
boolean useWhereTable = ("true").equals(ElementParameterParser.getValue(node, "__USE_WHERE_CONDITIONS_TABLE__"));
@@ -140,7 +142,7 @@ skeleton="../templates/db_output_bulk.skeleton"
columnList = metadata.getListColumns();
}
}
if(columnList != null && columnList.size()>0){
StringBuilder insertColName = new StringBuilder();
@@ -148,6 +150,7 @@ skeleton="../templates/db_output_bulk.skeleton"
boolean isUpdate = "UPDATE".equals(dataAction);
List<Map<String, String>> setColumns = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__SET_COLUMN__");
int counterOuter = 0;
for(IMetadataColumn column : columnList){
String suffix = ",";
@@ -159,12 +162,16 @@ skeleton="../templates/db_output_bulk.skeleton"
if(columnName==null || columnName.trim().isEmpty()){
columnName = column.getLabel();
}
if (columnName.startsWith("\"")) {
columnName = "\\" + columnName;
}
if (columnName.endsWith("\"") && !columnName.endsWith("\\\"")) {
columnName = columnName.substring(0, columnName.lastIndexOf("\"")) + "\\" + "\"";
//use empty string as need to keep old action if not autoWrapColumnName
if(MYSQL.equalsIgnoreCase(dbmsId) || SINGLESTORE.equalsIgnoreCase(dbmsId) || "amazon_aurora_id".equalsIgnoreCase(dbmsId)) {
columnName = ColumnHelper.wrapColumnNameByGraveAccentIfNecessary(autoWrapColumnName, "", columnName, "");
} else if(ACCESS.equalsIgnoreCase(dbmsId) || MSSQL.equalsIgnoreCase(dbmsId)) {
columnName = ColumnHelper.wrapColumnNameByBracketIfNecessary(autoWrapColumnName, "", columnName, "");
} else {
columnName = ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, "", columnName, "");
}
boolean isUpdateColumn = "true".equals(setColumns.get(counterOuter).get("UPDATE_COLUMN"));
insertColName.append(columnName).append(suffix);
if (isUpdate && isUpdateColumn) {
@@ -289,8 +296,8 @@ skeleton="../templates/db_output_bulk.skeleton"
Manager manager = null;
String tableAction = ElementParameterParser.getValue(node,"__TABLE_ACTION__");
List<Column> stmtStructure = getELTManager(dbmsId, cid, node).createColumnList(columnList, false, null, null);
List<Column> stmtStructure = getELTManager(dbmsId, cid, node, autoWrapColumnName).createColumnList(columnList, false, null, null);
String table = tableName;
dbLog = new DBLogUtil(node);

View File

@@ -128,8 +128,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -32,13 +32,6 @@
<PARAMETER NAME="PROPERTY" FIELD="PROPERTY_TYPE" SHOW="true"
NUM_ROW="1" REPOSITORY_VALUE="DATABASE:HIVE" />
<PARAMETER FIELD="LABEL" NAME="DEPRECATE_NOTE" COLOR="255;0;0"
NUM_ROW="6" REQUIRED="true"
SHOW_IF="(HIVE_VERSION=='MAPR500' OR HIVE_VERSION=='MAPR510' OR HIVE_VERSION=='MAPR520')"
GROUP="VERSION">
<DEFAULT>This distribution is deprecated</DEFAULT>
</PARAMETER>
<PARAMETER NAME="HIVE" FIELD="HADOOP_LIBRARIES" NUM_ROW="9"
SHOW="false" />
@@ -685,68 +678,6 @@
REQUIRED="false"
REQUIRED_IF="(CONFIGURATIONS_FROM_CLASSPATH == 'false') AND (DISTRIBUTION!='CUSTOM') AND (isShow[USE_KRB] AND USE_KRB=='true') AND (DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportKerberos[] AND ((DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportHive1[] AND DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportEmbeddedMode[] AND HIVE_SERVER=='HIVE' AND CONNECTION_MODE=='EMBEDDED') OR (DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportHive2[] AND HIVE_SERVER=='HIVE2')))" />
<!-- HDP_2_2 -->
<IMPORT MODULE_GROUP="HIVE-LIB-HDP_2_2_LASTEST"
REQUIRED_IF="HIVE_VERSION=='HDP_2_2' AND (DISTRIBUTION!='CUSTOM')" />
<!-- HDP_2_2 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-HDP_2_2_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_2' AND STORE_BY_HBASE=='true') AND (DISTRIBUTION!='CUSTOM')" />
<!-- Hive libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="HIVE-LIB-HDP_2_3"
REQUIRED_IF="HIVE_VERSION=='HDP_2_3' AND (DISTRIBUTION!='CUSTOM')" />
<!-- Hive HBase libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-HDP_2_3"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_3' AND STORE_BY_HBASE=='true') AND (DISTRIBUTION!='CUSTOM')" />
<!-- EMR 4_0_0 -->
<IMPORT MODULE_GROUP="HIVE-LIB-EMR_4_0_0_LATEST"
REQUIRED_IF="HIVE_VERSION=='EMR_4_0_0' AND (DISTRIBUTION!='CUSTOM')" />
<!-- MAPR401 -->
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR40X_LASTEST"
REQUIRED_IF="HIVE_VERSION=='MAPR401' AND (DISTRIBUTION!='CUSTOM')" />
<!-- MAPR500 -->
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR50X_LASTEST"
REQUIRED_IF="HIVE_VERSION=='MAPR500' AND (DISTRIBUTION!='CUSTOM')" />
<!-- MAPR401 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR40X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR401' AND STORE_BY_HBASE=='true') AND (DISTRIBUTION!='CUSTOM')" />
<!-- MAPR500 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR50X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR500' AND STORE_BY_HBASE=='true') AND (DISTRIBUTION!='CUSTOM')" />
<!-- ############## -->
<!-- HDP_2_1 Tez additional -->
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-HDP211"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_1') AND (DISTRIBUTION!='CUSTOM') AND (EXECUTION_ENGINE=='tez')" />
<!-- MapR401 Tez additional -->
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-MapR401"
REQUIRED_IF="(HIVE_VERSION=='MAPR401') AND (DISTRIBUTION!='CUSTOM') AND (EXECUTION_ENGINE=='tez')" />
<!-- MAPR410 -->
<IMPORTS REQUIRED_IF="(DISTRIBUTION!='CUSTOM')">
<IMPORTS REQUIRED_IF="(HIVE_VERSION=='MAPR410')">
<IMPORTS REQUIRED_IF="(EXECUTION_ENGINE!='tez')">
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR41X_LASTEST" />
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR41X_LASTEST"
REQUIRED_IF="(STORE_BY_HBASE=='true')" />
</IMPORTS>
<IMPORTS REQUIRED_IF="(EXECUTION_ENGINE=='tez')">
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-MapR410" />
<IMPORT MODULE_GROUP="HIVE100-LIB-MAPR41X_LASTEST" />
<IMPORT MODULE_GROUP="HIVE100-HBASE-LIB-MAPR41X_LASTEST"
REQUIRED_IF="(STORE_BY_HBASE=='true')" />
</IMPORTS>
</IMPORTS>
</IMPORTS>
<!-- Parquet libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="PARQUET-LIB-HDP_2_3"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_3') AND (DISTRIBUTION!='CUSTOM')" />
<!-- PARQUET SUPPORT -->
<IMPORT NAME="parquet-hive-bundle-1.5.0" MODULE="parquet-hive-bundle-1.5.0.jar"
MVN="mvn:org.talend.libraries/parquet-hive-bundle-1.5.0/6.0.0"

View File

@@ -30,29 +30,6 @@ DISTRIBUTION.ITEM.CUSTOM=Custom - Unsupported
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=Hive version
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0(Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0(Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0(BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0(Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1(YARN mode)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0(YARN mode)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0(YARN mode)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.PIVOTAL_HD_1_0_1=Pivotal HD 1.0.1
HIVE_VERSION.ITEM.PIVOTAL_HD_2_0=Pivotal HD 2.0
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive Server
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -30,29 +30,6 @@ DISTRIBUTION.ITEM.CUSTOM=Personnalis\u00E9 - Non support\u00E9
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=Version de Hive
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0 (Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0 (Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0 (BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1 (mode YARN)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0 (mode YARN)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0 (mode YARN)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.PIVOTAL_HD_1_0_1=Pivotal HD 1.0.1
HIVE_VERSION.ITEM.PIVOTAL_HD_2_0=Pivotal HD 2.0
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Serveur de Hive
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -30,29 +30,6 @@ DISTRIBUTION.ITEM.CUSTOM=\u30AB\u30B9\u30BF\u30E0 - \u975E\u30B5\u30DD\u30FC\u30
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=HIve\u30D0\u30FC\u30B8\u30E7\u30F3
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0(Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0(Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0 (BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.PIVOTAL_HD_1_0_1=Pivotal HD 1.0.1
HIVE_VERSION.ITEM.PIVOTAL_HD_2_0=Pivotal HD 2.0
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive\u30B5\u30FC\u30D0\u30FC
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -30,29 +30,6 @@ DISTRIBUTION.ITEM.CUSTOM=\u4E0D\u652F\u6301\u81EA\u5B9A\u4E49
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=Hive \u7248\u672C
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0(Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0(Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0 (BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.PIVOTAL_HD_1_0_1=Pivotal HD 1.0.1
HIVE_VERSION.ITEM.PIVOTAL_HD_2_0=Pivotal HD 2.0
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive Server
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -755,49 +755,6 @@
REQUIRED="false"
REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DISTRIBUTION!='CUSTOM') AND (USE_KRB=='true') AND (DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportKerberos[] AND ((DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportHive1[] AND DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportEmbeddedMode[] AND HIVE_SERVER=='HIVE' AND CONNECTION_MODE=='EMBEDDED') OR (DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportHive2[] AND HIVE_SERVER=='HIVE2')))" />
<!-- HDP_2_2 -->
<IMPORT MODULE_GROUP="HIVE-LIB-HDP_2_2_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_2') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- HDP_2_2 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-HDP_2_2_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_2' AND STORE_BY_HBASE=='true') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- Hive libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="HIVE-LIB-HDP_2_3"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_3') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- Hive HBase libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-HDP_2_3"
REQUIRED_IF="(HIVE_VERSION=='HDP_2_3' AND STORE_BY_HBASE=='true') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- ############## -->
<!-- EMR 4_0_0 -->
<IMPORT MODULE_GROUP="HIVE-LIB-EMR_4_0_0_LATEST"
REQUIRED_IF="HIVE_VERSION=='EMR_4_0_0' AND (USE_EXISTING_CONNECTION == 'false') AND (DISTRIBUTION!='CUSTOM')" />
<!-- MAPR401 -->
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR40X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR401') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- MAPR500 -->
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR50X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR500') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- MAPR401 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR40X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR401' AND STORE_BY_HBASE=='true') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- MAPR500 Hbase -->
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR50X_LASTEST"
REQUIRED_IF="(HIVE_VERSION=='MAPR500' AND STORE_BY_HBASE=='true') and (USE_EXISTING_CONNECTION == 'false') AND DISTRIBUTION!='CUSTOM'" />
<!-- ############## -->
<!-- MICROSOFT HD INSIGHT 3.1 && MICROSOFT HD INSIGHT 3.2 -->
<IMPORT MODULE_GROUP="HD_INSIGHT_COMMON_LIBRARIES_LATEST"
REQUIRED_IF="(DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportOldImportMode[]) AND (USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
<!-- Parquet libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="PARQUET-LIB-HDP_2_3"
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (USE_PARQUET=='true') AND (HIVE_VERSION=='HDP_2_3') AND (DISTRIBUTION!='CUSTOM')" />
<!-- PARQUET SUPPORT -->
<IMPORT NAME="parquet-hive-bundle-1.5.0" MODULE="parquet-hive-bundle-1.5.0.jar"
MVN="mvn:org.talend.libraries/parquet-hive-bundle-1.5.0/6.0.0"
@@ -810,41 +767,7 @@
<IMPORT NAME="snappy-java-1.0.5.jar" MODULE="snappy-java-1.0.5.jar"
MVN="mvn:org.talend.libraries/snappy-java-1.0.5/6.0.0"
REQUIRED_IF="(DISTRIB[DISTRIBUTION, HIVE_VERSION].doSupportOldImportMode[] AND USE_EXISTING_CONNECTION=='false' AND USE_PARQUET=='true' AND DISTRIBUTION!='CUSTOM' AND HIVE_VERSION!='MAPR2' AND HIVE_VERSION!='APACHE_1_0_0' AND HIVE_VERSION!='PIVOTAL_HD_1_0_1')" />
<!-- ############## -->
<!-- HDP_2_1 Tez additional -->
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-HDP211"
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (HIVE_VERSION=='HDP_2_1') AND (DISTRIBUTION!='CUSTOM') AND (EXECUTION_ENGINE=='tez')" />
<!-- MapR401 Tez additional -->
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-MapR401"
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (HIVE_VERSION=='MAPR401') AND (DISTRIBUTION!='CUSTOM') AND (EXECUTION_ENGINE=='tez')" />
<!-- MAPR410 -->
<IMPORTS
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION!='CUSTOM')">
<IMPORTS REQUIRED_IF="(HIVE_VERSION=='MAPR410')">
<IMPORTS REQUIRED_IF="(EXECUTION_ENGINE!='tez')">
<IMPORT MODULE_GROUP="HIVE-LIB-MAPR41X_LASTEST" />
<IMPORT MODULE_GROUP="HIVE-HBASE-LIB-MAPR41X_LASTEST"
REQUIRED_IF="(STORE_BY_HBASE=='true')" />
</IMPORTS>
<IMPORTS REQUIRED_IF="(EXECUTION_ENGINE=='tez')">
<IMPORT MODULE_GROUP="HIVE-TEZ-LIB-MapR410" />
<IMPORT MODULE_GROUP="HIVE100-LIB-MAPR41X_LASTEST" />
<IMPORT MODULE_GROUP="HIVE100-HBASE-LIB-MAPR41X_LASTEST"
REQUIRED_IF="(STORE_BY_HBASE=='true')" />
</IMPORTS>
</IMPORTS>
</IMPORTS>
<!-- HDP_2_2 Tez additional -->
<IMPORT MODULE_GROUP="TEZ-LIB-HDP220"
REQUIRED_IF="(DISTRIBUTION == 'HORTONWORKS') AND (HIVE_VERSION == 'HDP_2_2') AND (EXECUTION_ENGINE == 'tez')" />
<IMPORT MODULE_GROUP="TEZ-SERVER-LIB-HDP220"
REQUIRED_IF="(DISTRIBUTION == 'HORTONWORKS') AND (HIVE_VERSION == 'HDP_2_2') AND (EXECUTION_ENGINE == 'tez') AND (TEZ_LIB == 'INSTALL')" />
<!-- Tez libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="TEZ-LIB-HDP_2_3"
REQUIRED_IF="(DISTRIBUTION == 'HORTONWORKS') AND (HIVE_VERSION == 'HDP_2_3') AND (EXECUTION_ENGINE == 'tez')" />
<!-- Tez Server libraries for HDP_2_3 -->
<IMPORT MODULE_GROUP="TEZ-SERVER-LIB-HDP_2_3"
REQUIRED_IF="(DISTRIBUTION == 'HORTONWORKS') AND (HIVE_VERSION == 'HDP_2_3') AND (EXECUTION_ENGINE == 'tez') AND (TEZ_LIB == 'INSTALL')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -70,27 +70,6 @@ DISTRIBUTION.ITEM.CUSTOM=Custom - Unsupported
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=Hive version
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0(Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0(Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0(BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0(Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1(YARN mode)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0(YARN mode)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0(YARN mode)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive Server
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -70,27 +70,7 @@ DISTRIBUTION.ITEM.CUSTOM=Personnalis\u00E9 - Non support\u00E9
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=Version de Hive
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0 (Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0 (Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0 (BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1 (mode YARN)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0 (mode YARN)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0 (mode YARN)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Serveur de Hive
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -70,27 +70,6 @@ DISTRIBUTION.ITEM.CUSTOM=\u30AB\u30B9\u30BF\u30E0 - \u975E\u30B5\u30DD\u30FC\u30
DISTRIBUTION.ITEM.AMAZON_EMR=Amazon EMR
DISTRIBUTION.ITEM.MICROSOFT_HD_INSIGHT=Microsoft HD Insight
HIVE_VERSION.NAME=HIve\u30D0\u30FC\u30B8\u30E7\u30F3
HIVE_VERSION.ITEM.HDP_1_2=Hortonworks Data Platform V1.2.0(Bimota)
HIVE_VERSION.ITEM.HDP_1_3=Hortonworks Data Platform V1.3.0(Condor)
HIVE_VERSION.ITEM.HDP_2_0=Hortonworks Data Platform V2.0.0 (BigWheel)
HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0(YARN\u30E2\u30FC\u30C9)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive\u30B5\u30FC\u30D0\u30FC
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -77,20 +77,6 @@ HIVE_VERSION.ITEM.HDP_2_1=Hortonworks Data Platform V2.1.0 (Baikal)
HIVE_VERSION.ITEM.HDP_2_2=Hortonworks Data Platform V2.2.0
HIVE_VERSION.ITEM.HDP_2_3=Hortonworks Data Platform V2.3.2
HIVE_VERSION.ITEM.APACHE_1_0_0=Apache 1.0.0 (Hive 0.9.0)
HIVE_VERSION.ITEM.MAPR2=MapR 2.0.0
HIVE_VERSION.ITEM.MAPR212=MapR 2.1.2
HIVE_VERSION.ITEM.MAPR213=MapR 2.1.3
HIVE_VERSION.ITEM.MAPR301=MapR 3.0.1
HIVE_VERSION.ITEM.MAPR310=MapR 3.1.0
HIVE_VERSION.ITEM.MAPR401=MapR 4.0.1 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.MAPR410=MapR 4.1.0 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.MAPR500=MapR 5.0.0 (YARN \u6A21\u5F0F)
HIVE_VERSION.ITEM.EMR_4_0_0=EMR 4.0.0 (Hive 1.0.0)
HIVE_VERSION.ITEM.APACHE_1_0_3_EMR=Apache 1.0.3 (Hive 0.8.1)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR=Apache 2.4.0 (Hive 0.11.0)
HIVE_VERSION.ITEM.APACHE_2_4_0_EMR_0_13_1=Apache 2.4.0 (Hive 0.13.1)
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_1=Microsoft HD Insight 3.1
HIVE_VERSION.ITEM.MICROSOFT_HD_INSIGHT_3_2=Microsoft HD Insight 3.2
HIVE_SERVER.NAME=Hive Server
HIVE_SERVER.ITEM.HIVE=Hive 1
HIVE_SERVER.ITEM.HIVE2=Hive 2

View File

@@ -39,6 +39,7 @@ imports="
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode) codeGenArgument.getArgument();
String cid = node.getUniqueName();
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
List<Map<String, String>> spArgs =
(List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__SP_ARGS__");
@@ -195,7 +196,7 @@ if (canGenerate) {
method = "Bytes";
} else if (("Integer").equals(typeToGenerate)) {
method = "Int";
} else {
} else {
method = typeToGenerate.substring(0, 1).toUpperCase() + typeToGenerate.substring(1);
}
@@ -229,12 +230,25 @@ if (canGenerate) {
oracle.xdb.XMLType xmlType_<%=cid%> = oracle.xdb.XMLType.createXML(connection_<%=cid%>, <%=inConnectionName%>.<%=argName%>);
statement_<%=cid%>.setObject(<%=argIndex%>, xmlType_<%=cid%>);
<%
} else {
%>
statement_<%=cid%>.set<%=method%>(<%=argIndex%>, <%=inConnectionName%>.<%=argName%>);
<%
}
} else if (("String").equals(typeToGenerate) && "CLOB".equals(dbType)) {
%>
java.sql.Clob clob_<%=cid %> = connection_<%=cid %>.createClob();
clob_<%=cid %>.setString(1, <%=inConnectionName%>.<%=argName%>);
statement_<%=cid%>.setClob(<%=argIndex%>, clob_<%=cid %>);
<%
} else {
if (isLog4jEnabled && ("String").equals(typeToGenerate)) {
%>
if (<%=inConnectionName%>.<%=argName%>.length() > 4000) {
log.warn("String value is too long for VARCHAR type");
}
<%
}
%>
statement_<%=cid%>.set<%=method%>(<%=argIndex%>, <%=inConnectionName%>.<%=argName%>);
<%
}
if (nullable) {
%>
}

View File

@@ -33,6 +33,9 @@ skeleton="../templates/db_output_bulk.skeleton"
boolean useExistingS3Connection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION_S3__"));
String s3ConnectionCid = ElementParameterParser.getValue(node,"__CONNECTION_S3__");
int driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
boolean useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
INode current_node = node;
if(useExistingS3Connection){
current_node = NodeUtil.getNodeByUniqueName(node.getProcess(),s3ConnectionCid,true);
@@ -80,6 +83,7 @@ skeleton="../templates/db_output_bulk.skeleton"
sbuilder_<%=cid%>.append("jdbc:redshift:");
<%
if ("SSO".equals(jdbcUrl)){
%>
sbuilder_<%=cid%>.append("iam:");
<%
@@ -92,7 +96,7 @@ skeleton="../templates/db_output_bulk.skeleton"
.append("/")
.append(<%=dbName%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
if(( useStringProperties || driveVersion == 1) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("?").append(<%=dbproperties%>);
<%
@@ -110,8 +114,12 @@ skeleton="../templates/db_output_bulk.skeleton"
String dbUser_<%=cid %> = <%=userName%>;
String dbPwd_<%=cid %> = decryptedPass_<%=cid%>;
<%
if(driveVersion == 2 && !useStringProperties){
log4jCodeGenerateUtil.connect(node);
log4jCodeGenerateUtil.connectWithProperties(node);
} else {
log4jCodeGenerateUtil.connect(node);
}
}
String tableAction = ElementParameterParser.getValue(node,"__TABLE_ACTION__");

View File

@@ -39,42 +39,55 @@
SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"
GROUP="DB_CONFIG" />
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="3"
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="5"
GROUP="DB_CONFIG"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_VERSION" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="13"
REPOSITORY_VALUE="SERVER_NAME" REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="3"
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="13"
REPOSITORY_VALUE="PORT" REQUIRED="true" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
GROUP="DB_CONFIG">
<DEFAULT>"5439"</DEFAULT>
</PARAMETER>
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="4"
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="14"
REPOSITORY_VALUE="SID" REQUIRED="true" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="4"
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="14"
REPOSITORY_VALUE="SCHEMA" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="4" SHOW="false"
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="14" SHOW="false"
REPOSITORY_VALUE="TYPE">
<DEFAULT>Redshift</DEFAULT>
</PARAMETER>
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="5"
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="15"
REPOSITORY_VALUE="USERNAME" REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') " GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="5"
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="15"
REPOSITORY_VALUE="PASSWORD" REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') " GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
@@ -83,13 +96,37 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="8"
NUM_ROW="18"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'" GROUP="DB_CONFIG">
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="10"
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="17"
REQUIRED="true"
GROUP="DB_CONFIG"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
GROUP="DB_CONFIG"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="18" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="20"
LOG4J_ENABLED="false" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -97,7 +134,7 @@
<PARAMETER
NAME="TABLE_ACTION"
FIELD="CLOSED_LIST"
NUM_ROW="12"
NUM_ROW="22"
NOT_SHOW_IF="PARALLELIZE == 'true'"
>
<ITEMS DEFAULT="NONE">
@@ -110,11 +147,11 @@
</ITEMS>
</PARAMETER>
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="15">
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="25">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="20"
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="30"
SHOW="false">
<DEFAULT>redshift_id</DEFAULT>
</PARAMETER>
@@ -122,7 +159,7 @@
<PARAMETER
NAME="DATA_SOURCE_TYPE"
FIELD="CLOSED_LIST"
NUM_ROW="25"
NUM_ROW="35"
>
<ITEMS DEFAULT="S3">
<ITEM NAME="S3" VALUE="S3" />
@@ -424,9 +461,10 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar"
MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar"
MVN="mvn:org.antlr/antlr4-runtime/4.8-1"
REQUIRED="true" />
@@ -457,6 +495,9 @@
<IMPORT NAME="commons-codec-1.14.jar" MODULE="commons-codec-1.14.jar"
MVN="mvn:commons-codec/commons-codec/1.14"
REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar"
MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x"
REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -12,6 +12,16 @@ USER.NAME=Username
TABLE_ACTION.NAME=Action on table
USE_SHARED_CONNECTION.NAME=Use or register a shared DB Connection
SHARED_CONNECTION_NAME.NAME=Shared DB Connection Name
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value
TABLE_ACTION.ITEM.NONE=None
TABLE_ACTION.ITEM.CREATE=Create table
TABLE_ACTION.ITEM.CREATE_IF_NOT_EXISTS=Create table if not exists

View File

@@ -3,19 +3,28 @@ imports="
org.talend.core.model.process.INode
org.talend.core.model.process.ElementParameterParser
org.talend.designer.codegen.config.CodeGeneratorArgument
java.util.List
java.util.Map
"
%>
<%@ include file="../templates/DB/HelpClass/HelpClass.javajet"%>
<%
class ConnectionUtil extends DefaultConnectionUtil{
int driveVersion;
Boolean useStringProperties ;
String logLevel;
public void createURL(INode node) {
super.createURL(node);
boolean useLogFile= "true".equals(ElementParameterParser.getValue(node, "__USE_LOG_FILE__"));
String logLevel= ElementParameterParser.getValue(node, "__LOG_LEVEL__");
String logFile= ElementParameterParser.getValue(node, "__LOG_FILE__");
String jdbcUrl = ElementParameterParser.getValue(node, "__JDBC_URL__");
driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
logLevel= ElementParameterParser.getValue(node, "__LOG_LEVEL__");
if(!logLevel.equals("0")){
if (useLogFile) {
@@ -43,11 +52,16 @@ imports="
.append(":")
.append(<%=dbport%>)
.append("/")
.append(<%=dbname%>)
.append("?loglevel=")
.append(<%=logLevel%>);
.append(<%=dbname%>);
<%
if( useStringProperties || driveVersion == 1){
%>
sbuilder_<%=cid%>.append("?loglevel=").append(<%=logLevel%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
}
if((driveVersion == 1 || useStringProperties) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("&").append(<%=dbproperties%>);
<%
@@ -56,6 +70,32 @@ imports="
String url_<%=cid%> = sbuilder_<%=cid%>.toString();
<%
}
public void createConnection(INode node) {
if(driveVersion == 2 && !useStringProperties){
List<Map<String, String>> properties = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
%>
java.util.Properties properties_<%=cid%> = new java.util.Properties();
properties_<%=cid%>.setProperty("user",dbUser_<%=cid%>);
properties_<%=cid%>.setProperty("password",dbPwd_<%=cid%>);
<%
for(Map<String, String> entry : properties){
%>
properties_<%=cid%>.setProperty(<%=entry.get("KEY")%>,<%=entry.get("VALUE")%>);
<%}%>
properties_<%=cid%>.setProperty("loglevel","<%=logLevel%>");
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,properties_<%=cid%>);
<%
} else {
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%
}
}
public String getDirverClassName(INode node){
return "com.amazon.redshift.jdbc42.Driver";

View File

@@ -44,10 +44,21 @@
REPOSITORY_VALUE="DATABASE:REDSHIFT"
/>
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="10"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="HOST"
FIELD="TEXT"
NUM_ROW="2"
NUM_ROW="20"
REPOSITORY_VALUE="SERVER_NAME"
REQUIRED="true"
>
@@ -57,7 +68,7 @@
<PARAMETER
NAME="TYPE"
FIELD="TEXT"
NUM_ROW="2"
NUM_ROW="20"
SHOW="false"
REPOSITORY_VALUE="TYPE"
>
@@ -67,7 +78,7 @@
<PARAMETER
NAME="PORT"
FIELD="TEXT"
NUM_ROW="2"
NUM_ROW="20"
REPOSITORY_VALUE="PORT"
REQUIRED="true"
>
@@ -77,7 +88,7 @@
<PARAMETER
NAME="DBNAME"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="30"
REPOSITORY_VALUE="SID"
REQUIRED="true"
>
@@ -87,7 +98,7 @@
<PARAMETER
NAME="SCHEMA_DB"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="30"
REPOSITORY_VALUE="SCHEMA"
>
<DEFAULT>""</DEFAULT>
@@ -96,7 +107,7 @@
<PARAMETER
NAME="USER"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="40"
REPOSITORY_VALUE="USERNAME"
REQUIRED="true"
>
@@ -106,25 +117,46 @@
<PARAMETER
NAME="PASS"
FIELD="PASSWORD"
NUM_ROW="4"
NUM_ROW="40"
REPOSITORY_VALUE="PASSWORD"
REQUIRED="true"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="45"
SHOW_IF="(DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
REQUIRED="true"
>
</PARAMETER>
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="5"
NUM_ROW="50"
SHOW_IF="((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
REPOSITORY_VALUE="PROPERTIES_STRING">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="50" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="ENCODING"
FIELD="ENCODING_TYPE"
NUM_ROW="5"
NUM_ROW="50"
REQUIRED="true"
SHOW="false"
>
@@ -134,7 +166,7 @@
<PARAMETER
NAME="USE_SHARED_CONNECTION"
FIELD="CHECK"
NUM_ROW="10"
NUM_ROW="100"
REQUIRED="true"
>
</PARAMETER>
@@ -142,7 +174,7 @@
<PARAMETER
NAME="SHARED_CONNECTION_NAME"
FIELD="TEXT"
NUM_ROW="10"
NUM_ROW="100"
REQUIRED="true"
SHOW_IF="USE_SHARED_CONNECTION == 'true'"
>
@@ -196,9 +228,13 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V1')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar" MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848" REQUIRED_IF="(JDBC_URL == 'SSO')" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar" MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x" REQUIRED_IF="(JDBC_URL == 'SSO')"/>
<IMPORT NAME="commons-logging-1.2.jar" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED_IF="(JDBC_URL == 'SSO')" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO')" />

View File

@@ -22,3 +22,12 @@ PROPERTIES.NAME=Additional JDBC Parameters
JDBC_URL.NAME=JDBC url
JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -17,12 +17,19 @@ imports="
class DBInputBeginUtil extends DefaultDBInputUtil{
int driveVersion;
Boolean useStringProperties ;
String logLevel;
public void setURL(INode node) {
boolean useLogFile= "true".equals(ElementParameterParser.getValue(node, "__USE_LOG_FILE__"));
String logLevel= ElementParameterParser.getValue(node, "__LOG_LEVEL__");
String logFile= ElementParameterParser.getValue(node, "__LOG_FILE__");
String jdbcUrl = ElementParameterParser.getValue(node, "__JDBC_URL__");
driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
logLevel= ElementParameterParser.getValue(node, "__LOG_LEVEL__");
if(!logLevel.equals("0")){
if (useLogFile) {
@@ -51,11 +58,16 @@ imports="
.append(":")
.append(<%=dbport%>)
.append("/")
.append(<%=dbname%>)
.append("?loglevel=")
.append(<%=logLevel%>);
.append(<%=dbname%>);
<%
if( useStringProperties || driveVersion == 1){
%>
sbuilder_<%=cid%>.append("?loglevel=").append(<%=logLevel%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
}
if(( useStringProperties || driveVersion == 1) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("&").append(<%=dbproperties%>);
<%
@@ -64,19 +76,48 @@ imports="
String url_<%=cid%> = sbuilder_<%=cid%>.toString();
<%
}
public void createConnection(INode node) {
driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
%>
//<%=driveVersion%> useStringProperties: <%=useStringProperties%>
<%
if(driveVersion == 2 && !useStringProperties){
super.createConnection(node,2);//without connection
List<Map<String, String>> properties = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
%>
java.util.Properties properties_<%=cid%> = new java.util.Properties();
properties_<%=cid%>.setProperty("user",dbUser_<%=cid%>);
properties_<%=cid%>.setProperty("password",dbPwd_<%=cid%>);
<%
for(Map<String, String> entry : properties){
%>
properties_<%=cid%>.setProperty(<%=entry.get("KEY")%>,<%=entry.get("VALUE")%>);
<%}%>
properties_<%=cid%>.setProperty("loglevel","<%=logLevel%>");
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,properties_<%=cid%>);
<%
log4jCodeGenerateUtil.connect_end();
}else{
super.createConnection(node);
}
String useCursor= ElementParameterParser.getValue(node, "__USE_CURSOR__");
if(("true").equals(useCursor)) {
log4jCodeGenerateUtil.autoCommit(node,false);
}
}
public String getDirverClassName(INode node){
return "com.amazon.redshift.jdbc42.Driver";
}
public void createConnection(INode node) {
String jdbcUrl = ElementParameterParser.getValue(node, "__JDBC_URL__");
super.createConnection(node);
String useCursor= ElementParameterParser.getValue(node, "__USE_CURSOR__");
if(("true").equals(useCursor)) {
log4jCodeGenerateUtil.autoCommit(node,false);
}
}
public void createStatement(INode node) {
super.createStatement(node);

View File

@@ -44,10 +44,22 @@
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
/>
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="5"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="USE_EXISTING_CONNECTION"
FIELD="CHECK"
NUM_ROW="2"
NUM_ROW="12"
>
<DEFAULT>false</DEFAULT>
</PARAMETER>
@@ -56,7 +68,7 @@
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
REQUIRED="true" FILTER="tRedshiftConnection"
NUM_ROW="2"
NUM_ROW="12"
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
DYNAMIC_SETTINGS="true"
/>
@@ -64,7 +76,7 @@
<PARAMETER
NAME="HOST"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="13"
REPOSITORY_VALUE="SERVER_NAME"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -75,7 +87,7 @@
<PARAMETER
NAME="TYPE"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="13"
SHOW="false"
REPOSITORY_VALUE="TYPE"
>
@@ -85,7 +97,7 @@
<PARAMETER
NAME="PORT"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="13"
REPOSITORY_VALUE="PORT"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -96,7 +108,7 @@
<PARAMETER
NAME="DBNAME"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="14"
REPOSITORY_VALUE="SID"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -107,7 +119,7 @@
<PARAMETER
NAME="SCHEMA_DB"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="14"
REPOSITORY_VALUE="SCHEMA"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
>
@@ -117,7 +129,7 @@
<PARAMETER
NAME="USER"
FIELD="TEXT"
NUM_ROW="5"
NUM_ROW="15"
REPOSITORY_VALUE="USERNAME"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -128,7 +140,7 @@
<PARAMETER
NAME="PASS"
FIELD="PASSWORD"
NUM_ROW="5"
NUM_ROW="15"
REPOSITORY_VALUE="PASSWORD"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -139,16 +151,38 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="6"
NUM_ROW="20"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="18"
REQUIRED="true"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="20" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="SCHEMA"
FIELD="SCHEMA_TYPE"
NUM_ROW="7"
NUM_ROW="30"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -156,7 +190,7 @@
<PARAMETER
NAME="TABLE"
FIELD="DBTABLE"
NUM_ROW="8"
NUM_ROW="40"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -164,7 +198,7 @@
<PARAMETER
NAME="QUERYSTORE"
FIELD="QUERYSTORE_TYPE"
NUM_ROW="9"
NUM_ROW="50"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -172,7 +206,7 @@
<PARAMETER
NAME="GUESS_SCHEMA"
FIELD="GUESS_SCHEMA"
NUM_ROW="9"
NUM_ROW="50"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -180,7 +214,7 @@
<PARAMETER
NAME="QUERY"
FIELD="MEMO_SQL"
NUM_ROW="10"
NUM_ROW="60"
REQUIRED="true"
>
<DEFAULT>"select id, name from employee"</DEFAULT>
@@ -189,7 +223,7 @@
<PARAMETER
NAME="MAPPING"
FIELD="MAPPING_TYPE"
NUM_ROW="10"
NUM_ROW="60"
SHOW="false"
>
<DEFAULT>redshift_id</DEFAULT>
@@ -279,9 +313,13 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar" MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar" MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-logging-1.2.jar" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
@@ -290,6 +328,7 @@
<IMPORT NAME="httpclient-4.5.13.jar" MODULE="httpclient-4.5.13.jar" MVN="mvn:org.apache.httpcomponents/httpclient/4.5.13" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="joda-time-2.8.1.jar" MODULE="joda-time-2.8.1.jar" MVN="mvn:joda-time/joda-time/2.8.1" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-codec-1.14.jar" MODULE="commons-codec-1.14.jar" MVN="mvn:commons-codec/commons-codec/1.14" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -46,3 +46,12 @@ PROPERTIES.NAME=Additional JDBC Parameters
JDBC_URL.NAME=JDBC url
JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -198,6 +198,8 @@ if(("true").equals(useExistingConn)) {
%>
<%
} else {
int driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
boolean useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
%>
java.lang.Class.forName("com.amazon.redshift.jdbc42.Driver");
<%dbLog.conn().logJDBCDriver(dbLog.str("com.amazon.redshift.jdbc42.Driver"));%>
@@ -217,7 +219,7 @@ if(("true").equals(useExistingConn)) {
.append("/")
.append(<%=dbname%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
if(( useStringProperties || driveVersion == 1) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("?").append(<%=dbproperties%>);
<%
@@ -232,7 +234,27 @@ if(("true").equals(useExistingConn)) {
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
String dbPwd_<%=cid %> = decryptedPassword_<%=cid%>;
<%
if(driveVersion == 2 && !useStringProperties){
List<Map<String, String>> properties = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
%>
java.util.Properties properties_<%=cid%> = new java.util.Properties();
properties_<%=cid%>.setProperty("user",dbUser_<%=cid%>);
properties_<%=cid%>.setProperty("password",dbPwd_<%=cid%>);
<%
for(Map<String, String> entry : properties){
%>
properties_<%=cid%>.setProperty(<%=entry.get("KEY")%>,<%=entry.get("VALUE")%>);
<%}%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,properties_<%=cid%>);
<%
}else{
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%}%>
<%dbLog.conn().connTry(dbLog.var("url"), dbLog.var("dbUser"));%>
<%dbLog.conn().connDone(dbLog.var("url"));%>

View File

@@ -56,6 +56,18 @@
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="5"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="CONNECTION"
FIELD="COMPONENT_LIST"
@@ -68,7 +80,7 @@
<PARAMETER
NAME="HOST"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="8"
REPOSITORY_VALUE="SERVER_NAME"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -79,7 +91,7 @@
<PARAMETER
NAME="PORT"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="8"
REPOSITORY_VALUE="PORT"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -90,7 +102,7 @@
<PARAMETER
NAME="DBNAME"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="14"
REPOSITORY_VALUE="SID"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -101,7 +113,7 @@
<PARAMETER
NAME="TYPE"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="8"
SHOW="false"
REPOSITORY_VALUE="TYPE"
>
@@ -111,7 +123,7 @@
<PARAMETER
NAME="SCHEMA_DB"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="14"
REPOSITORY_VALUE="SCHEMA"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
>
@@ -121,7 +133,7 @@
<PARAMETER
NAME="USER"
FIELD="TEXT"
NUM_ROW="5"
NUM_ROW="15"
REPOSITORY_VALUE="USERNAME"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -132,7 +144,7 @@
<PARAMETER
NAME="PASS"
FIELD="PASSWORD"
NUM_ROW="5"
NUM_ROW="15"
REPOSITORY_VALUE="PASSWORD"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -143,16 +155,37 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="6"
NUM_ROW="20"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="18"
REQUIRED="true"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="20" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="TABLE"
FIELD="DBTABLE"
NUM_ROW="7"
NUM_ROW="25"
REQUIRED="true"
>
<DEFAULT>""</DEFAULT>
@@ -161,7 +194,7 @@
<PARAMETER
NAME="TABLE_ACTION"
FIELD="CLOSED_LIST"
NUM_ROW="8"
NUM_ROW="30"
NOT_SHOW_IF="PARALLELIZE == 'true'"
>
<ITEMS DEFAULT="NONE">
@@ -177,7 +210,7 @@
<PARAMETER
NAME="DATA_ACTION"
FIELD="CLOSED_LIST"
NUM_ROW="8"
NUM_ROW="30"
>
<ITEMS DEFAULT="INSERT">
<ITEM NAME="INSERT" VALUE="INSERT" />
@@ -191,7 +224,7 @@
<PARAMETER
NAME="SCHEMA_FLOW"
FIELD="SCHEMA_TYPE"
NUM_ROW="9"
NUM_ROW="40"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -200,7 +233,7 @@
NAME="SCHEMA_REJECT"
FIELD="SCHEMA_TYPE"
REQUIRED="true"
NUM_ROW="9"
NUM_ROW="40"
CONTEXT="REJECT"
SHOW="true">
<TABLE READONLY="true">
@@ -212,7 +245,7 @@
<PARAMETER
NAME="DIE_ON_ERROR"
FIELD="CHECK"
NUM_ROW="10"
NUM_ROW="50"
>
<DEFAULT>false</DEFAULT>
</PARAMETER>
@@ -220,7 +253,7 @@
<PARAMETER
NAME="MAPPING"
FIELD="MAPPING_TYPE"
NUM_ROW="11"
NUM_ROW="60"
SHOW="false"
>
<DEFAULT>redshift_id</DEFAULT>
@@ -388,9 +421,13 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar" MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar" MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-logging-1.2.jar" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />

View File

@@ -88,3 +88,12 @@ JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
USE_ALTERNATE_SCHEMA.NAME=Use alternate schema
ALTERNATE_SCHEMA.NAME=Schema
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -38,37 +38,51 @@
SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"
GROUP="DB_CONFIG" />
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="3" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="5"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
GROUP="DB_CONFIG"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="8" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SERVER_NAME" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="3" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="8" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="PORT" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>"5439"</DEFAULT>
</PARAMETER>
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="4" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="10" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SID" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="4" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="10" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SCHEMA" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="4" SHOW="false"
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="10" SHOW="false"
REPOSITORY_VALUE="TYPE">
<DEFAULT>Redshift</DEFAULT>
</PARAMETER>
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="5" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="12" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
REPOSITORY_VALUE="USERNAME" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="5" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="12" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
REPOSITORY_VALUE="PASSWORD" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -76,19 +90,41 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="8"
NUM_ROW="15"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="10"
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="14"
REQUIRED="true"
GROUP="DB_CONFIG"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
GROUP="DB_CONFIG"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="15" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="20"
LOG4J_ENABLED="false" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TABLE_ACTION" FIELD="CLOSED_LIST" NUM_ROW="12"
<PARAMETER NAME="TABLE_ACTION" FIELD="CLOSED_LIST" NUM_ROW="25"
NOT_SHOW_IF="PARALLELIZE == 'true'">
<ITEMS DEFAULT="NONE">
<ITEM NAME="NONE" VALUE="NONE" />
@@ -100,16 +136,16 @@
</ITEMS>
</PARAMETER>
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="15">
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="27">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="20"
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="30"
SHOW="false">
<DEFAULT>redshift_id</DEFAULT>
</PARAMETER>
<PARAMETER NAME="FILE" FIELD="FILE" NUM_ROW="25"
<PARAMETER NAME="FILE" FIELD="FILE" NUM_ROW="31"
GROUP="DATA_FILE_CONFIG" REQUIRED="true">
<DEFAULT>"__COMP_DEFAULT_FILE_DIR__/redshift_bulk.txt"</DEFAULT>
</PARAMETER>
@@ -598,6 +634,9 @@
<TEMPLATE_PARAM SOURCE="self.TABLE" TARGET="tRBE.TABLE" />
<TEMPLATE_PARAM SOURCE="self.TABLE_ACTION" TARGET="tRBE.TABLE_ACTION" />
<TEMPLATE_PARAM SOURCE="self.MAPPING" TARGET="tRBE.MAPPING" />
<TEMPLATE_PARAM SOURCE="self.DRIVER_VERSION" TARGET="tRBE.DRIVER_VERSION" />
<TEMPLATE_PARAM SOURCE="self.USE_STRING_PROPERTIES" TARGET="tRBE.USE_STRING_PROPERTIES" />
<TEMPLATE_PARAM SOURCE="self.ENTRY_PROPERTIES" TARGET="tRBE.ENTRY_PROPERTIES" />
<TEMPLATE_PARAM SOURCE="self.ACCESS_KEY" TARGET="tRBE.ACCESS_KEY" />
<TEMPLATE_PARAM SOURCE="self.SECRET_KEY" TARGET="tRBE.SECRET_KEY" />
@@ -675,15 +714,19 @@
</TEMPLATES>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar"
MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar"
MVN="mvn:org.antlr/antlr4-runtime/4.8-1"
REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar"
MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848"
REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar"
MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x"
REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar"
MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4"
REQUIRED="true" />

View File

@@ -182,3 +182,12 @@ ROLE_TABLE.ITEM.ROLE_ARN=Role ARN
JDBC_URL.NAME=JDBC url
JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -4,6 +4,7 @@ imports="
org.talend.core.model.process.ElementParameterParser
org.talend.designer.codegen.config.CodeGeneratorArgument
java.util.List
java.util.Map
java.util.ArrayList
"
%>
@@ -11,6 +12,10 @@ imports="
<%
class DBRowBeginUtil extends DefaultDBRowUtil{
int driveVersion;
Boolean useStringProperties ;
String logLevel;
public void beforeComponentProcess(INode node){
super.beforeComponentProcess(node);
@@ -19,6 +24,9 @@ imports="
public void setURL(INode node) {
String jdbcUrl = ElementParameterParser.getValue(node, "__JDBC_URL__");
driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
%>
StringBuilder sbuilder_<%=cid%> = new StringBuilder();
sbuilder_<%=cid%>.append("jdbc:redshift:");
@@ -36,7 +44,7 @@ imports="
.append("/")
.append(<%=dbname%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
if(( useStringProperties || driveVersion == 1) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("?").append(<%=dbproperties%>);
<%
@@ -45,6 +53,30 @@ imports="
String url_<%=cid%> = sbuilder_<%=cid%>.toString();
<%
}
public void newConnection(INode node) {
if(driveVersion == 2 && !useStringProperties){
List<Map<String, String>> properties = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
%>
java.util.Properties properties_<%=cid%> = new java.util.Properties();
properties_<%=cid%>.setProperty("user",dbUser_<%=cid%>);
properties_<%=cid%>.setProperty("password",dbPwd_<%=cid%>);
<%
for(Map<String, String> entry : properties){
%>
properties_<%=cid%>.setProperty(<%=entry.get("KEY")%>,<%=entry.get("VALUE")%>);
<%}%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,properties_<%=cid%>);
<%
}else{
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%
}
}
public String getDirverClassName(INode node){
return "com.amazon.redshift.jdbc42.Driver";

View File

@@ -63,10 +63,22 @@
DYNAMIC_SETTINGS="true"
/>
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="5"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="HOST"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="7"
REPOSITORY_VALUE="SERVER_NAME"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -77,7 +89,7 @@
<PARAMETER
NAME="PORT"
FIELD="TEXT"
NUM_ROW="3"
NUM_ROW="7"
REPOSITORY_VALUE="PORT"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -88,7 +100,7 @@
<PARAMETER
NAME="DBNAME"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="10"
REPOSITORY_VALUE="SID"
REQUIRED="true"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
@@ -99,7 +111,7 @@
<PARAMETER
NAME="SCHEMA_DB"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="10"
REPOSITORY_VALUE="SCHEMA"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
>
@@ -109,7 +121,7 @@
<PARAMETER
NAME="TYPE"
FIELD="TEXT"
NUM_ROW="4"
NUM_ROW="10"
SHOW="false"
REPOSITORY_VALUE="TYPE"
>
@@ -119,7 +131,7 @@
<PARAMETER
NAME="USER"
FIELD="TEXT"
NUM_ROW="5"
NUM_ROW="12"
REPOSITORY_VALUE="USERNAME"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -130,7 +142,7 @@
<PARAMETER
NAME="PASS"
FIELD="PASSWORD"
NUM_ROW="5"
NUM_ROW="12"
REPOSITORY_VALUE="PASSWORD"
REQUIRED="true"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
@@ -141,16 +153,37 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="6"
NUM_ROW="15"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="14"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
REQUIRED="true"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="20" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER
NAME="SCHEMA_FLOW"
FIELD="SCHEMA_TYPE"
NUM_ROW="7"
NUM_ROW="25"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -159,7 +192,7 @@
NAME="SCHEMA_REJECT"
FIELD="SCHEMA_TYPE"
REQUIRED="true"
NUM_ROW="7"
NUM_ROW="25"
CONTEXT="REJECT"
SHOW="true">
<TABLE READONLY="true">
@@ -171,7 +204,7 @@
<PARAMETER
NAME="TABLE"
FIELD="DBTABLE"
NUM_ROW="7"
NUM_ROW="25"
LOG4J_ENABLED="false"
>
<DEFAULT>""</DEFAULT>
@@ -180,7 +213,7 @@
<PARAMETER
NAME="QUERYSTORE"
FIELD="QUERYSTORE_TYPE"
NUM_ROW="8"
NUM_ROW="30"
>
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -188,7 +221,7 @@
<PARAMETER
NAME="QUERY"
FIELD="MEMO_SQL"
NUM_ROW="9"
NUM_ROW="40"
>
<DEFAULT>"select id, name from employee"</DEFAULT>
</PARAMETER>
@@ -196,7 +229,7 @@
<PARAMETER
NAME="DIE_ON_ERROR"
FIELD="CHECK"
NUM_ROW="10"
NUM_ROW="50"
>
<DEFAULT>false</DEFAULT>
</PARAMETER>
@@ -297,9 +330,13 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar" MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar" MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-logging-1.2.jar" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />

View File

@@ -61,3 +61,12 @@ PROPERTIES.NAME=Additional JDBC Parameters
JDBC_URL.NAME=JDBC url
JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -50,6 +50,8 @@ imports="
<%
log4jCodeGenerateUtil.useExistConnection(node);
} else {
int driveVersion = "DRIVER_V2".equals(ElementParameterParser.getValue(node, "__DRIVER_VERSION__"))? 2 : 1;
boolean useStringProperties = "true".equals(ElementParameterParser.getValue(node, "__USE_STRING_PROPERTIES__"));
%>
String driverClass_<%=cid%> = "com.amazon.redshift.jdbc42.Driver";
Class.forName(driverClass_<%=cid%>).newInstance();
@@ -69,7 +71,7 @@ imports="
.append("/")
.append(<%=dbName%>);
<%
if(dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
if(( useStringProperties || driveVersion == 1) && dbproperties != null && !"\"\"".equals(dbproperties) && !"".equals(dbproperties)) {
%>
sbuilder_<%=cid%>.append("?").append(<%=dbproperties%>);
<%
@@ -86,8 +88,13 @@ imports="
<%}%>
String dbUser_<%=cid %> = <%=userName%>;
String dbPwd_<%=cid %> = decryptedPass_<%=cid%>;
<%
log4jCodeGenerateUtil.connect(node);
<%
if(driveVersion == 2 && !useStringProperties){
List<Map<String, String>> properties = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
log4jCodeGenerateUtil.connectWithProperties(node);
} else {
log4jCodeGenerateUtil.connect(node);
}
}
boolean log4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));

View File

@@ -38,22 +38,35 @@
SHOW_IF="USE_EXISTING_CONNECTION == 'true'" DYNAMIC_SETTINGS="true"
GROUP="DB_CONFIG" />
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="3" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER
NAME="DRIVER_VERSION"
FIELD="CLOSED_LIST"
NUM_ROW="10"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false')"
GROUP="DB_CONFIG"
REPOSITORY_VALUE="DRIVER_VERSION">
<ITEMS DEFAULT="DRIVER_V2">
<ITEM NAME="DRIVER_V1" VALUE="DRIVER_V1" />
<ITEM NAME="DRIVER_V2" VALUE="DRIVER_V2" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="HOST" FIELD="TEXT" NUM_ROW="30" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SERVER_NAME" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="3" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="PORT" FIELD="TEXT" NUM_ROW="30" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="PORT" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>"5439"</DEFAULT>
</PARAMETER>
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="4" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="DBNAME" FIELD="TEXT" NUM_ROW="40" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SID" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="4" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
<PARAMETER NAME="SCHEMA_DB" FIELD="TEXT" NUM_ROW="40" SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
REPOSITORY_VALUE="SCHEMA" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -63,12 +76,12 @@
<DEFAULT>Redshift</DEFAULT>
</PARAMETER>
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="5" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
<PARAMETER NAME="USER" FIELD="TEXT" NUM_ROW="50" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
REPOSITORY_VALUE="USERNAME" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="5" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
<PARAMETER NAME="PASS" FIELD="PASSWORD" NUM_ROW="50" SHOW_IF="(USE_EXISTING_CONNECTION == 'false') "
REPOSITORY_VALUE="PASSWORD" REQUIRED="true" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
@@ -76,26 +89,48 @@
<PARAMETER
NAME="PROPERTIES"
FIELD="TEXT"
NUM_ROW="8"
NUM_ROW="80"
REPOSITORY_VALUE="PROPERTIES_STRING"
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND ((USE_STRING_PROPERTIES == 'true') AND (DRIVER_VERSION == 'DRIVER_V2')) OR (DRIVER_VERSION == 'DRIVER_V1')"
GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="10"
<PARAMETER
NAME="USE_STRING_PROPERTIES"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
REPOSITORY_VALUE="USE_STRING_PROPERTIES"
FIELD="CHECK"
NUM_ROW="70"
REQUIRED="true"
GROUP="DB_CONFIG"
>
</PARAMETER>
<PARAMETER NAME="ENTRY_PROPERTIES" FIELD="TABLE"
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (USE_STRING_PROPERTIES == 'false') AND (DRIVER_VERSION == 'DRIVER_V2')"
GROUP="DB_CONFIG"
REPOSITORY_VALUE="ENTRY_PROPERTIES"
REQUIRED="false" NUM_ROW="80" NB_LINES="4">
<ITEMS>
<ITEM NAME="KEY" />
<ITEM NAME="VALUE" />
</ITEMS>
</PARAMETER>
<PARAMETER NAME="TABLE" FIELD="DBTABLE" NUM_ROW="100"
LOG4J_ENABLED="false" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="15" GROUP="DB_CONFIG">
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" NUM_ROW="150" GROUP="DB_CONFIG">
<DEFAULT>""</DEFAULT>
</PARAMETER>
<PARAMETER
NAME="QUERYSTORE"
FIELD="QUERYSTORE_TYPE"
NUM_ROW="16"
NUM_ROW="160"
GROUP="DB_CONFIG"
>
<DEFAULT>""</DEFAULT>
@@ -104,29 +139,29 @@
<PARAMETER
NAME="QUERY"
FIELD="MEMO_SQL"
NUM_ROW="17"
NUM_ROW="170"
GROUP="DB_CONFIG"
>
<DEFAULT>"select id, name from employee"</DEFAULT>
</PARAMETER>
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="22"
<PARAMETER NAME="MAPPING" FIELD="MAPPING_TYPE" NUM_ROW="220"
SHOW="false">
<DEFAULT>redshift_id</DEFAULT>
</PARAMETER>
<PARAMETER NAME="USE_EXISTING_CONNECTION_S3" FIELD="CHECK"
NUM_ROW="46" GROUP="S3_CONFIG" SHOW_IF="ASSUME_ROLE == 'false'">
NUM_ROW="460" GROUP="S3_CONFIG" SHOW_IF="ASSUME_ROLE == 'false'">
<DEFAULT>false</DEFAULT>
</PARAMETER>
<PARAMETER NAME="CONNECTION_S3" FIELD="COMPONENT_LIST" REQUIRED="true" FILTER="tS3Connection"
NUM_ROW="46" SHOW_IF="USE_EXISTING_CONNECTION_S3 == 'true'" GROUP="S3_CONFIG"/>
NUM_ROW="460" SHOW_IF="USE_EXISTING_CONNECTION_S3 == 'true'" GROUP="S3_CONFIG"/>
<PARAMETER
NAME="ACCESS_KEY"
FIELD="TEXT"
NUM_ROW="50"
NUM_ROW="500"
REQUIRED="true"
NOT_SHOW_IF="(USE_EXISTING_CONNECTION_S3 == 'true') OR isShow[ASSUME_ROLE] AND (ASSUME_ROLE == 'true')"
GROUP="S3_CONFIG"
@@ -137,7 +172,7 @@
<PARAMETER
NAME="SECRET_KEY"
FIELD="PASSWORD"
NUM_ROW="50"
NUM_ROW="500"
REQUIRED="true"
NOT_SHOW_IF="(USE_EXISTING_CONNECTION_S3 == 'true') OR isShow[ASSUME_ROLE] AND (ASSUME_ROLE == 'true')"
GROUP="S3_CONFIG"
@@ -148,7 +183,7 @@
<PARAMETER
NAME="ASSUME_ROLE"
FIELD="CHECK"
NUM_ROW="60"
NUM_ROW="600"
REQUIRED="true"
GROUP="S3_CONFIG"
NOT_SHOW_IF="USE_EXISTING_CONNECTION_S3 == 'true'"
@@ -159,7 +194,7 @@
<PARAMETER
NAME="ROLE_TABLE"
FIELD="TABLE"
NUM_ROW="65"
NUM_ROW="650"
SHOW_IF="isShow[ASSUME_ROLE] AND (ASSUME_ROLE == 'true')"
GROUP="S3_CONFIG"
>
@@ -171,7 +206,7 @@
<PARAMETER
NAME="BUCKET"
FIELD="TEXT"
NUM_ROW="100"
NUM_ROW="1000"
REQUIRED="true"
GROUP="S3_CONFIG"
>
@@ -181,7 +216,7 @@
<PARAMETER
NAME="OBJECTS_PREFIX"
FIELD="TEXT"
NUM_ROW="100"
NUM_ROW="1000"
REQUIRED="false"
GROUP="S3_CONFIG"
>
@@ -283,9 +318,13 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Redshift" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083" REQUIRED="true" />
<IMPORT NAME="Driver-Redshift-V2" MODULE="redshift-jdbc42-2.1.0.3.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42/2.1.0.3"
REQUIRED_IF="(DRIVER_VERSION == 'DRIVER_V2') AND (USE_EXISTING_CONNECTION == 'false')"/>
<IMPORT NAME="Driver-Redshift-V1" MODULE="redshift-jdbc42-no-awssdk-1.2.55.1083.jar" MVN="mvn:com.amazon.redshift/redshift-jdbc42-no-awssdk/1.2.55.1083"
REQUIRED_IF="(DRIVER_VERSION=='DRIVER_V1') and (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="antlr4-runtime-4.8-1.jar" MODULE="antlr4-runtime-4.8-1.jar" MVN="mvn:org.antlr/antlr4-runtime/4.8-1" REQUIRED="true" />
<IMPORT NAME="aws-java-sdk-1.11.848.jar" MODULE="aws-java-sdk-1.11.848.jar" MVN="mvn:com.amazonaws/aws-java-sdk/1.11.848" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="aws-java-sdk-redshift-internal-1.12.x.jar" MODULE="aws-java-sdk-redshift-internal-1.12.x.jar" MVN="mvn:com.amazonaws/aws-java-sdk-redshift-internal/1.12.x" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="commons-logging-1.2.jar" MODULE="commons-logging-1.2.jar" MVN="mvn:commons-logging/commons-logging/1.2" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-databind-2.11.4.jar" MODULE="jackson-databind-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-databind/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />
<IMPORT NAME="jackson-core-2.11.4.jar" MODULE="jackson-core-2.11.4.jar" MVN="mvn:com.fasterxml.jackson.core/jackson-core/2.11.4" REQUIRED_IF="(JDBC_URL == 'SSO') AND (USE_EXISTING_CONNECTION == 'false')" />

View File

@@ -49,3 +49,13 @@ ROLE_TABLE.ITEM.ROLE_ARN=Role ARN
JDBC_URL.NAME=JDBC url
JDBC_URL.ITEM.STANDARD=Standard
JDBC_URL.ITEM.SSO=SSO
DRIVER_VERSION.NAME=Driver version
DRIVER_VERSION.ITEM.DRIVER_V1=Driver v1
DRIVER_VERSION.ITEM.DRIVER_V2=Driver v2
USE_STRING_PROPERTIES.NAME=Use String JDBC parameters
ENTRY_PROPERTIES.NAME=Additional JDBC Parameters
ENTRY_PROPERTIES.ITEM.KEY=Key
ENTRY_PROPERTIES.ITEM.VALUE=Value

View File

@@ -11,13 +11,12 @@ imports="
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
String conn = "conn_" + connection;
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection '<%= connection %>' to the server.");
<%}%>
closeCloseableConnections("<%=conn%>");
closeCloseableConnections("session_<%=connection%>","conn_<%=connection%>");
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection '<%= connection %>' to the server closed.");
<%}%>

View File

@@ -144,13 +144,12 @@ imports="
}else{
throw se_<%=cid%>;
}
}finally{
session_<%=cid%>.close();
}
globalMap.put("conn_<%=cid%>",client_<%=cid%>);
globalMap.put("session_<%=cid%>",session_<%=cid%>);

View File

@@ -16,6 +16,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -31,30 +31,6 @@ imports="
}
%>
StringBuilder command_<%=cid %> = new StringBuilder("rm -f");
/* open a session */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
log.debug("<%=cid%> - execute the command: " + command_<%=cid %>.toString());
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
<%
@@ -85,7 +61,7 @@ imports="
org.apache.sshd.client.channel.ClientChannelEvent.CLOSED,org.apache.sshd.client.channel.ClientChannelEvent.EXIT_STATUS), 0L);
exit_code_<%=cid%> = channel_<%=cid%>.getExitStatus();
channel_<%=cid%>.close();
session_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.debug("Channel Events: "+ java.util.Arrays.toString(clientChannelEvents_<%=cid %>.toArray()));
<%}%>

View File

@@ -21,12 +21,13 @@ imports="
String privatekey = ElementParameterParser.getValue(node,"__PRIVATEKEY__");
String password = ElementParameterParser.getValue(node,"__PASSWORD__");
String passphrase = ElementParameterParser.getValue(node,"__PASSPHRASE__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
%>
/* Create a connection instance */
<%
String useExistingConn = ElementParameterParser.getValue(node, "__USE_EXISTING_CONNECTION__");
if(("true").equals(useExistingConn)){
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
String conn= "conn_" + connection;
INode connectionNode = NodeUtil.getNodeByUniqueName(node.getProcess(), connection);
host = ElementParameterParser.getValue(connectionNode, "__HOST__");
@@ -138,13 +139,40 @@ imports="
<%}%>
client_<%=cid%>.start();
<%
}//if(isExistingConn)
}//if(useExistingConn)
%>
/* Create a session */
org.apache.sshd.client.session.ClientSession session_<%=cid%> = null;
int port_<%=cid%> = Integer.parseInt(<%=port %>+"");
StringBuilder stringStdout_<%=cid%> =new StringBuilder();
StringBuilder stringStderr_<%=cid%> =new StringBuilder();
Integer exit_code_<%=cid%> = null;
/* open a session */
<%if(("true").equals(useExistingConn)){%>
org.apache.sshd.client.session.ClientSession session_<%=cid%> = (org.apache.sshd.client.session.ClientSession)globalMap.get("session_<%=connection%>");
<%}else{%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
<%}%>
org.apache.sshd.client.session.ClientSession session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
<%}%>

View File

@@ -17,6 +17,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -45,29 +45,10 @@ imports="
}
globalMap.put("<%=cid %>_FILENAME", <%=fileExists %>);
/* open a session */
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - execute the command: " + command_<%=cid %>.toString());
<%}%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
log.debug("<%=cid%> - execute the command: " + command_<%=cid %>.toString());
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
org.apache.sshd.client.channel.ClientChannel channel_<%=cid %> = session_<%=cid %>.createExecChannel((command_<%=cid %>).toString());
java.io.ByteArrayOutputStream stdout_<%=cid %> = new java.io.ByteArrayOutputStream();
java.io.ByteArrayOutputStream stderr_<%=cid %> = new java.io.ByteArrayOutputStream();
@@ -79,7 +60,7 @@ imports="
org.apache.sshd.client.channel.ClientChannelEvent.CLOSED,org.apache.sshd.client.channel.ClientChannelEvent.EXIT_STATUS), 0L);
exit_code_<%=cid%> = channel_<%=cid%>.getExitStatus();
channel_<%=cid%>.close();
session_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.debug("Channel Events: "+ java.util.Arrays.toString(clientChannelEvents_<%=cid %>.toArray()));
<%}%>
@@ -106,3 +87,6 @@ imports="
<%}%>
globalMap.put("<%=cid %>_STATUS", stringStderr_<%=cid %>.toString());
}
stringStdout_<%=cid%> =new StringBuilder();
stringStderr_<%=cid%> =new StringBuilder();

View File

@@ -23,13 +23,14 @@ imports="
String password = ElementParameterParser.getValue(node,"__PASSWORD__");
String passphrase = ElementParameterParser.getValue(node,"__PASSPHRASE__");
String commandSeparator = ElementParameterParser.getValue(node, "__COMMANDSEPARATOR__");
List<Map<String, String>> filelist = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__FILELIST__");
List<Map<String, String>> filelist = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__FILELIST__");
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
%>
/* Create a connection instance */
<%
String useExistingConn = ElementParameterParser.getValue(node, "__USE_EXISTING_CONNECTION__");
if(("true").equals(useExistingConn)){
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
INode connectionNode = NodeUtil.getNodeByUniqueName(node.getProcess(), connection);
host = ElementParameterParser.getValue(connectionNode, "__HOST__");
port = ElementParameterParser.getValue(connectionNode, "__PORT__");
@@ -141,39 +142,35 @@ imports="
%>
client_<%=cid%>.start();
int port_<%=cid%> = Integer.parseInt(<%=port %>+"");
/* Create a session */
org.apache.sshd.client.session.ClientSession session_<%=cid%> = null;
/* open a session */
/* Now connect */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to '" +<%=host%> + "' has succeeded.");
<%}%>
/* open a session */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Authentication using a password.");
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(<%=user%>, <%=host%>, Integer.parseInt(<%=port %>+"")).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
<%if(("true").equals(useExistingConn)){%>
org.apache.sshd.client.session.ClientSession session_<%=cid%> = (org.apache.sshd.client.session.ClientSession)globalMap.get("session_<%=connection%>");
<%}else{%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
<%}%>
org.apache.sshd.client.session.ClientSession session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
}
<%}%>
//execute the command
//initial the command
@@ -205,7 +202,6 @@ imports="
org.apache.sshd.client.channel.ClientChannelEvent.CLOSED,org.apache.sshd.client.channel.ClientChannelEvent.EXIT_STATUS), 0L);
exit_code_<%=cid%> = channel_<%=cid%>.getExitStatus();
channel_<%=cid%>.close();
session_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.debug("Channel Events: "+ java.util.Arrays.toString(clientChannelEvents_<%=cid %>.toArray()));
<%}%>

View File

@@ -21,6 +21,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -17,6 +17,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -25,28 +25,7 @@ imports="
authMethod = ElementParameterParser.getValue(connectionNode,"__AUTH_METHOD__");
}
%>
/* open a session */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
org.apache.sshd.scp.client.ScpClientCreator instance_<%=cid%> = org.talend.components.talendscp.TalendScpClientCreator.INSTANCE;
org.apache.sshd.scp.client.ScpClient scp_<%=cid%> = instance_<%=cid%>.createScpClient(session_<%=cid%>);
@@ -166,7 +145,7 @@ globalMap.put("<%=cid%>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
scp_<%=cid%>.download("\""+sourceFile_<%=cid %>+"\"",out_<%=cid %>);
} catch(java.lang.Exception e_<%=cid%>) {
globalMap.put("<%=cid%>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
globalMap.put("<%=cid%>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
if(out_<%=cid %> != null){
out_<%=cid %>.close();
}
@@ -209,8 +188,4 @@ globalMap.put("<%=cid%>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
globalMap.put("<%=cid %>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
throw e_<%=cid%>;
}finally {
if(session_<%=cid%> != null) {
session_<%=cid%>.close();
}
}

View File

@@ -17,6 +17,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -50,28 +50,6 @@ imports="
java.nio.file.Path[] sourceFileNames_<%=cid%> = sourceList_<%=cid %>.toArray(new java.nio.file.Path[0]);
/* open a session */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
org.apache.sshd.scp.client.ScpClientCreator instance_<%=cid%> = org.talend.components.talendscp.TalendScpClientCreator.INSTANCE;
org.apache.sshd.scp.client.ScpClient scp_<%=cid%> = instance_<%=cid%>.createScpClient(session_<%=cid%>);
try{
@@ -92,4 +70,3 @@ globalMap.put("<%=cid%>_ERROR_MESSAGE",e.getMessage());
<%}%>
globalMap.put("<%=cid %>_STATUS", "File put fail.");
}
session_<%=cid%>.close();

View File

@@ -18,6 +18,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -27,29 +27,9 @@ imports="
//initial the command
StringBuilder command_<%=cid %> = new StringBuilder();
command_<%=cid %>.append("mv \"").append(<%=fromName%>).append("\" \"").append(<%=toName%>).append("\"");
/* Create a session */
//execute the command
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
log.debug("<%=cid%> - execute the command: " + command_<%=cid %>.toString());
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
//execute the command
org.apache.sshd.client.channel.ClientChannel channel_<%=cid %> = session_<%=cid %>.createExecChannel((command_<%=cid %>).toString());
java.io.ByteArrayOutputStream stdout_<%=cid %> = new java.io.ByteArrayOutputStream();
java.io.ByteArrayOutputStream stderr_<%=cid %> = new java.io.ByteArrayOutputStream();
@@ -61,7 +41,7 @@ imports="
org.apache.sshd.client.channel.ClientChannelEvent.CLOSED,org.apache.sshd.client.channel.ClientChannelEvent.EXIT_STATUS), 0L);
exit_code_<%=cid%> = channel_<%=cid%>.getExitStatus();
channel_<%=cid%>.close();
session_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.debug("Channel Events: "+ java.util.Arrays.toString(clientChannelEvents_<%=cid %>.toArray()));
<%}%>

View File

@@ -20,6 +20,7 @@ imports="
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Closing the connection to the server.");
<%}%>
session_<%=cid%>.close();
client_<%=cid%>.close();
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Connection to the server closed.");

View File

@@ -25,28 +25,6 @@ imports="
}
%>
/* open a session */
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Open up a session.");
<%}%>
session_<%=cid%> = client_<%=cid%>.connect(username_<%=cid%>, hostname_<%=cid%>, port_<%=cid%>).verify().getClientSession();
try {
session_<%=cid%>.auth().verify();
}catch (org.apache.sshd.common.SshException se_<%=cid%>){
globalMap.put("<%=cid %>_EXIT_CODE",se_<%=cid%>.getDisconnectCode());
<%
if (("PUBLICKEY").equals(authMethod)) {
%>
java.nio.file.Files.write(privateKey_<%=cid%>,lines_<%=cid%>);
<%}%>
if(14 == se_<%=cid%>.getDisconnectCode()){
throw new IllegalArgumentException("Authentication failed.");
}else{
throw se_<%=cid%>;
}
}
org.apache.sshd.scp.client.ScpClientCreator instance_<%=cid%> = org.talend.components.talendscp.TalendScpClientCreator.INSTANCE;
org.apache.sshd.scp.client.ScpClient scp_<%=cid%> = instance_<%=cid%>.createScpClient(session_<%=cid%>);
@@ -81,4 +59,3 @@ globalMap.put("<%=cid%>_ERROR_MESSAGE",e_<%=cid%>.getMessage());
globalMap.put("<%=cid %>_STATUS", "File truncate fail.");
}
}
session_<%=cid%>.close();

View File

@@ -205,61 +205,79 @@ if(!hasDynamic) {
%>
//Set limit
<%
if(!("").equals(limit)) {
%>
int limit_<%=cid%> = <%=limit%>;
<%
}
if(limit!=null && !("").equals(limit) && !("\"\"").equals(limit)) {
%>
//URL builder
org.apache.http.client.methods.HttpGet <%=cid%>_httpget = new org.apache.http.client.methods.HttpGet(
<%=cid%>_URL
+ "/api/now/table/"
+ <%=tablename%>
+ "?sysparm_exclude_reference_link=true&sysparm_limit="
+ limit_<%=cid%>
+ <%=cid%>_conditions
final int LIMIT_<%=cid%> = <%=limit%>;
<%
if(!hasDynamic) {
} else {
%>
+ <%=cid%>_fields
final int LIMIT_<%=cid%> = 0;
<%
}
}
%>
);
//Header builder
<%=cid%>_httpget.setHeader("Accept", "application/json");
//activate Cookie header only if unreliable connection
//<%=cid%>_httpget.setHeader("Cookie", "BIGipServerpool_sandbox=440453642.33598.0000; JSESSIONID=4100538B6BBF00B5568DF143FF815AF7; _ga=GA1.2.1976595674.1437483024; __CJ_tabs2_list_sys_user=%220%22; __CJ_g_startTime=%221437483102682%22; glide_user_route=glide.a1e7d977b734181b528e29363f053207");
<%
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Executing method '" + <%=cid%>_httpget.getRequestLine().getMethod() + "'");
<%
}
%>
//Get
org.apache.http.client.methods.CloseableHttpResponse <%=cid%>_response = <%=cid%>_httpclient.execute(<%=cid%>_httpget);
<%
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Execution code '" + <%=cid%>_response.getStatusLine().getStatusCode() + "'");
<%
}
%>
try {
String <%=cid%>_responseBody;
org.json.JSONObject <%=cid%>_json;
org.json.JSONArray <%=cid%>_resultArray;
int <%=cid%>_responseLength, <%=cid%>_i;
org.json.JSONObject <%=cid%>_result = null;
try {
<%=cid%>_responseBody = org.apache.http.util.EntityUtils.toString(<%=cid%>_response.getEntity());
<%=cid%>_json = new org.json.JSONObject(<%=cid%>_responseBody);
if (<%=cid%>_response.getStatusLine().getStatusCode() == 200) {
//Store result as JSON
<%=cid%>_resultArray = (org.json.JSONArray) <%=cid%>_json.get("result");
<%=cid%>_responseLength = <%=cid%>_resultArray.length();
//Pass values to output
for (<%=cid%>_i = 0; <%=cid%>_i < <%=cid%>_responseLength; <%=cid%>_i++) {
int offset_<%=cid%> = 0;
int limit_<%=cid%> = LIMIT_<%=cid%> > 0 ? LIMIT_<%=cid%> : 1000;
int total_<%=cid%> = 0;
try {
while(true) {
//URL builder
StringBuilder strb_<%=cid%> = new StringBuilder();
strb_<%=cid%>.append(<%=cid%>_URL).append("/api/now/table/").append(<%=tablename%>).append("?sysparm_exclude_reference_link=true")
.append("&sysparm_offset=").append(offset_<%=cid%>).append("&sysparm_limit=").append(limit_<%=cid%>).append(<%=cid%>_conditions);
offset_<%=cid%> += limit_<%=cid%>;
<%
if(!hasDynamic) {
%>
strb_<%=cid%>.append(<%=cid%>_fields);
<%
}
%>
org.apache.http.client.methods.HttpGet <%=cid%>_httpget = new org.apache.http.client.methods.HttpGet(strb_<%=cid%>.toString());
//Header builder
<%=cid%>_httpget.setHeader("Accept", "application/json");
//activate Cookie header only if unreliable connection
//<%=cid%>_httpget.setHeader("Cookie", "BIGipServerpool_sandbox=440453642.33598.0000; JSESSIONID=4100538B6BBF00B5568DF143FF815AF7; _ga=GA1.2.1976595674.1437483024; __CJ_tabs2_list_sys_user=%220%22; __CJ_g_startTime=%221437483102682%22; glide_user_route=glide.a1e7d977b734181b528e29363f053207");
<%
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Executing method '" + <%=cid%>_httpget.getRequestLine().getMethod() + "'");
<%
}
%>
//Get
org.apache.http.client.methods.CloseableHttpResponse <%=cid%>_response = <%=cid%>_httpclient.execute(<%=cid%>_httpget);
<%
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Execution code '" + <%=cid%>_response.getStatusLine().getStatusCode() + "'");
<%
}
%>
org.apache.http.Header header_<%=cid%> = <%=cid%>_response.getFirstHeader("Link");
String <%=cid%>_responseBody;
org.json.JSONObject <%=cid%>_json;
org.json.JSONArray <%=cid%>_resultArray;
int <%=cid%>_responseLength, <%=cid%>_i;
org.json.JSONObject <%=cid%>_result = null;
try {
<%=cid%>_responseBody = org.apache.http.util.EntityUtils.toString(<%=cid%>_response.getEntity());
<%=cid%>_json = new org.json.JSONObject(<%=cid%>_responseBody);
if (<%=cid%>_response.getStatusLine().getStatusCode() == 200) {
//Store result as JSON
<%=cid%>_resultArray = (org.json.JSONArray) <%=cid%>_json.get("result");
<%=cid%>_responseLength = <%=cid%>_resultArray.length();
total_<%=cid%> += <%=cid%>_responseLength;
if(<%=cid%>_responseLength == 0) {//already read limit number records, so quit
break;
}
//Pass values to output
for (<%=cid%>_i = 0; <%=cid%>_i < <%=cid%>_responseLength; <%=cid%>_i++) {

View File

@@ -16,7 +16,7 @@ INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
%>
}// responce loop
}// response loop
try{
String error_<%=cid%> = ((org.json.JSONObject)<%=cid%>_json.get("error")).getString("message");
String detail_<%=cid%> = ((org.json.JSONObject)<%=cid%>_json.get("error")).getString("detail");
@@ -31,7 +31,7 @@ if(isLog4jEnabled){
<%
}
%>
}catch(org.json.JSONException je_<%=cid%>){
}catch(org.json.JSONException je_<%=cid%>){
//ignore
}
} else {
@@ -44,7 +44,14 @@ if(isLog4jEnabled){
} finally {
<%=cid%>_response.close();
}
if(LIMIT_<%=cid%> == total_<%=cid%>) {
break;
}
}// end outside while loop
} finally {
<%=cid%>_httpclient.close();
<%=cid%>_httpclient.close();
}
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);

View File

@@ -437,7 +437,7 @@
<DEFAULT>1000</DEFAULT>
</PARAMETER>
<PARAMETER COLOR="0;0;0" FIELD="LABEL" NAME="INFO" NUM_ROW="51" REQUIRED="true">
<DEFAULT>If limit set to empty "" string or 0 it will be disabled.</DEFAULT>
<DEFAULT>Limit is disabled if set to 0 or empty "" string.</DEFAULT>
</PARAMETER>
<PARAMETER FIELD="CHECK" NAME="ENABLE_ADVANCED_CONDITIONS" NUM_ROW="90" >
<DEFAULT>false</DEFAULT>

View File

@@ -149,8 +149,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
<IMPORT NAME="slf4j-api-1.7.29.jar" MODULE="slf4j-api-1.7.29.jar" MVN="mvn:org.slf4j/slf4j-api/1.7.29" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
<IMPORT NAME="slf4j-log4j12-1.7.29.jar" MODULE="slf4j-log4j12-1.7.29.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.29" REQUIRED_IF="USE_SHARED_CONNECTION =='true'" />
</IMPORTS>

View File

@@ -281,10 +281,7 @@
<TEMPLATE_PARAM SOURCE="self.FILE_EXIST_EXCEPTION" TARGET="Out.FILE_EXIST_EXCEPTION" />
</TEMPLATES>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02"
REQUIRED_IF="IS_VIRTUAL_COMPONENT=='true'" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02"
REQUIRED_IF="IS_VIRTUAL_COMPONENT=='true'" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED_IF="IS_VIRTUAL_COMPONENT=='true'" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -162,8 +162,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -130,10 +130,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02"
REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02"
REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -351,8 +351,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -276,8 +276,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -239,8 +239,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="terajdbc4-16.20.00.02" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="tdgssconfig-16.20.00.02" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -334,8 +334,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-16.20.00.02.jar" MVN="mvn:com.teradata/terajdbc4/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="tdgssconfig-16.20.00.02.jar" MVN="mvn:com.teradata/tdgssconfig/16.20.00.02" REQUIRED="true" />
<IMPORT NAME="Driver-Teradata" MODULE="terajdbc4-17.10.00.27.jar" MVN="mvn:com.teradata.jdbc/terajdbc4/17.10.00.27" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -51,6 +51,19 @@ imports="
}
public void createConnection(INode node, boolean needUserAndPassword) {
createConnection(node,needUserAndPassword ? 1 : 0);
}
/*
* mode:
* 0. Without User and Password
* 1. need User And Password
* 2. without connection
*/
public void createConnection(INode node, int mode) {
cid = node.getUniqueName();
dbproperties = ElementParameterParser.getValue(node, "__PROPERTIES__");
dbhost = ElementParameterParser.getValue(node, "__HOST__");
@@ -90,23 +103,25 @@ imports="
<%this.setURL(node);%>
<%
log4jCodeGenerateUtil.debugConnectionParams(node);
if (!needUserAndPassword){
if (mode == 0){
log4jCodeGenerateUtil.connect_begin_noUser();
} else {
log4jCodeGenerateUtil.connect_begin();
}
%>
<%
if(needUserAndPassword) {
if(mode == 1) {
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%
} else {
} else if(mode ==0){
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>);
<%
}
if(mode != 2){
log4jCodeGenerateUtil.connect_end();
}
%>
<%this.afterUseNewConnection(node);%>
<%

View File

@@ -51,12 +51,18 @@
//do nothing as default
//for sybase jdbc in java 11, we have to call jdbcclazz.newInstance method
}
public void newConnection(){
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%
}
public void newConnection(INode node){
%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>,dbUser_<%=cid%>,dbPwd_<%=cid%>);
<%
}
public void createConnection(INode node, boolean needUserAndPassword) {
useExistingConn = ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__");
@@ -104,7 +110,7 @@
String dbPwd_<%=cid %> = decryptedPassword_<%=cid%>;
<%log4jCodeGenerateUtil.connect_begin();
newConnection();
newConnection(node);
} else {
log4jCodeGenerateUtil.connect_begin_noUser();
%>

View File

@@ -92,6 +92,26 @@ imports="
<%
connect_end();
}
public void connectWithProperties(INode node){
beforeComponentProcess(node);
connect_begin();
java.util.List<java.util.Map<String, String>> properties = (java.util.List<java.util.Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ENTRY_PROPERTIES__");
%>
java.util.Properties properties_<%=cid%> = new java.util.Properties();
properties_<%=cid%>.setProperty("user",dbUser_<%=cid%>);
properties_<%=cid%>.setProperty("password",dbPwd_<%=cid%>);
<%
for(java.util.Map<String, String> entry : properties){
%>
properties_<%=cid%>.setProperty(<%=entry.get("KEY")%>,<%=entry.get("VALUE")%>);
<%}%>
conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid%>,properties_<%=cid%>);
<%
connect_end();
}
public void connect_begin(){
logInfo(node,"debug",cid+" - Connection attempt to '\" + url_"+cid+" + \"' with the username '\" + dbUser_"+cid+" + \"'.");

View File

@@ -3,7 +3,7 @@
<%
Boolean isParallelize ="true".equalsIgnoreCase(ElementParameterParser.getValue(node, "__PARALLELIZE__"));
if (!isParallelize) {
manager = getELTManager(dbmsId, cid, node);
manager = getELTManager(dbmsId, cid, node, autoWrapColumnName);
String ending="";

View File

@@ -241,21 +241,6 @@ public class CLASS {
public void setDynamic(boolean isDynamic) {
this.isDynamic = isDynamic;
}
public String getWrappedColumnName(String lProtectedChar, String rProtectedChar) {
String wrappedColumnName = getColumnName();
if (!isDynamic()) {
if (!lProtectedChar.equals("\\\"") && wrappedColumnName.startsWith("\"")) {
wrappedColumnName = "\\" + wrappedColumnName;
}
if (!rProtectedChar.equals("\\\"") && wrappedColumnName.endsWith("\"") && !wrappedColumnName.endsWith("\\\"")) {
wrappedColumnName = wrappedColumnName.substring(0, wrappedColumnName.lastIndexOf("\"")) + "\\" + "\"";
}
}
return lProtectedChar + wrappedColumnName + rProtectedChar;
}
}
public Column getColumn(IMetadataColumn column) {
@@ -282,7 +267,10 @@ public class CLASS {
this.dbVersion = dbVersion;
}
protected String cid;
protected String cid;
protected boolean autoWrapColumnName;
protected abstract String getDBMSId();
protected abstract String getLProtectedChar();
protected abstract String getRProtectedChar();
@@ -290,32 +278,44 @@ public class CLASS {
public Manager(String cid) {
this.cid = cid;
}
protected String getLProtectedChar(String columName) {
return getLProtectedChar();
}
protected String getRProtectedChar(String columName) {
return getRProtectedChar();
}
protected boolean contaionsSpaces(String columnName) {
if (columnName != null) {
if (columnName.startsWith("\" + ") && columnName.endsWith(" + \"")) {
return false;
}
protected String getLProtectedChar(String columName) {
return getLProtectedChar();
}
protected String getRProtectedChar(String columName) {
return getRProtectedChar();
}
protected void setAutoWrapColumnName(boolean autoWrapColumnName) {
this.autoWrapColumnName = autoWrapColumnName;
}
//if autoWrapColumnName, may not use lProtectedChar/rProtectedChar, as they will be empty char if not need to wrap without key words of current database
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return lProtectedChar + columnName + rProtectedChar;
}
//wrap column name when white space or something appear
protected boolean contaionsSpaces(String columnName) {
if (columnName != null) {
if (columnName.startsWith("\" + ") && columnName.endsWith(" + \"")) {
return false;
}
if (columnName.startsWith("\\\"") && columnName.endsWith("\\\"")) {
return false;
}
if (columnName.startsWith("\\\"") && columnName.endsWith("\\\"")) {
return false;
}
if (columnName.contains(" ")) {
return true;
}
// minus are also a problem
if (columnName.contains("-")) {
return true;
}
}
return false;
}
if (columnName.contains(" ")) {
return true;
}
// minus are also a problem
if (columnName.contains("-")) {
return true;
}
}
return false;
}
public String getSelectionSQL() {
StringBuilder selectionSQL = new StringBuilder();
@@ -380,9 +380,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(column.getWrappedColumnName(getLProtectedChar(column.getColumnName()), getRProtectedChar(column.getColumnName())));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(column.getWrappedColumnName(getLProtectedChar(column.getColumnName()), getRProtectedChar(column.getColumnName())) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -476,7 +476,7 @@ public class CLASS {
if(column.isAutoIncrement()) {
// move the autoincrease key column to the first index in the primary defination. Otherwise, it will throw exception
if(MYSQL.equalsIgnoreCase(getDBMSId()) || SINGLESTORE.equalsIgnoreCase(getDBMSId())) {
String columnStr = column.getWrappedColumnName(getLProtectedChar(column.getColumnName()), getRProtectedChar(column.getColumnName()));
String columnStr = getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName()));
int index = pkList.indexOf(columnStr);
if(index !=-1){
for (int i=index;i>0;i--) {
@@ -1527,7 +1527,7 @@ public class CLASS {
return dropTableSQL.toString();
}
public String getCreateTableSQL(List<Column> columnList) {
public String getCreateTableSQL(List<Column> columnList) {
MappingTypeRetriever mappingType = MetadataTalendType.getMappingTypeRetriever(getDBMSId());
StringBuilder createSQL = new StringBuilder();
createSQL.append("CREATE TABLE " + getLProtectedChar() + "\" + tableName_" + cid + " + \"" + getRProtectedChar() + "(");
@@ -1564,9 +1564,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -2132,9 +2132,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -2967,8 +2967,6 @@ public class CLASS {
MappingTypeRetriever mappingType = MetadataTalendType.getMappingTypeRetriever(getDBMSId());
StringBuilder createSQL = new StringBuilder();
createSQL.append(redshiftTracker +" \\n " + "CREATE TABLE " + getLProtectedChar() + "\" + tableName_" + cid + " + \"" + getRProtectedChar() + "(");
List<String> pkList = new ArrayList<String>();
int count = 0;
@@ -3003,9 +3001,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -3696,9 +3694,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -4056,9 +4054,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
if(column.isAutoIncrement()) {
createSQL.append(getAutoIncrement(column.getStartValue(), column.getStep()));
} else {
@@ -4281,9 +4279,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -4528,9 +4526,9 @@ public class CLASS {
createSQL.append(" {TALEND_DYNAMIC_COLUMN} ").append(ending);
} else {
if (column.isKey()) {
pkList.add(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ));
pkList.add(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())));
}
createSQL.append(getLProtectedChar( column.getColumnName() ) + column.getColumnName() + getRProtectedChar( column.getColumnName() ) + " ");
createSQL.append(getWrappedColumnName(getLProtectedChar(column.getColumnName()), column.getColumnName(), getRProtectedChar(column.getColumnName())) + " ");
String dataType = null;
if (column.getColumn().getType() == null || column.getColumn().getType().trim().equals("")) {
dataType = mappingType.getDefaultSelectedDbType(column.getColumn().getTalendType());
@@ -4639,8 +4637,8 @@ public class CLASS {
return "";
}
}
public class DELTALAKEManager extends Manager {
public class DELTALAKEManager extends Manager {
public DELTALAKEManager(String cid) {
super(cid);
}
@@ -4682,6 +4680,87 @@ public class CLASS {
//////////////////////////////////////////////////////////////////////////////////
//the managers which only work for tELTJDBCOutput component, we add it to ignore the text quote which wrap the schema, table or column name.
//getLProtectedChar()/getRProtectedChar() works for schema/table quote more
//getRProtectedChar(String columName) works for wrap column name
//ELT not support dynamic column, add and replace column
static class ColumnHelper {
static java.util.regex.Pattern basicNamePattern = java.util.regex.Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*");
//lProtectedChar and rProtectedChar may be empty string or other char which is not double quote, do this for old job migration
static String wrapColumnNameByDoubleQuoteIfNecessary(boolean autoWrapColumnName, String lProtectedChar, String columnName, String rProtectedChar) {
//any head or tail invisible char is not valid column name
columnName = columnName.trim();
boolean alreadyWrapped = columnName.startsWith("\\\"") && columnName.endsWith("\\\"");
if(alreadyWrapped) {
return lProtectedChar + columnName + rProtectedChar;
}
if(autoWrapColumnName) {
if(basicNamePattern.matcher(columnName).matches()) {
return lProtectedChar + columnName + rProtectedChar;
}
return "\\\"" + columnName + "\\\"";
}
//if db column name starts with double quote or (ends with double quote and not escape that double quote), sure compiler issue,
//so correct it here, so no migration issue as break already before
if (columnName.startsWith("\"")) {
columnName = "\\" + columnName;
}
if (columnName.endsWith("\"") && !columnName.endsWith("\\\"")) {
columnName = columnName.substring(0, columnName.lastIndexOf("\"")) + "\\\"";
}
return lProtectedChar + columnName + rProtectedChar;
}
static String wrapColumnNameByGraveAccentIfNecessary(boolean autoWrapColumnName, String lProtectedChar, String columnName, String rProtectedChar) {
columnName = columnName.trim();
boolean alreadyWrapped = columnName.startsWith("`") && columnName.endsWith("`");
if(alreadyWrapped) {
return lProtectedChar + columnName + rProtectedChar;
}
if(autoWrapColumnName) {
if(basicNamePattern.matcher(columnName).matches()) {
return lProtectedChar + columnName + rProtectedChar;
}
return "`" + columnName + "`";
}
return lProtectedChar + columnName + rProtectedChar;
}
static String wrapColumnNameByBracketIfNecessary(boolean autoWrapColumnName, String lProtectedChar, String columnName, String rProtectedChar) {
columnName = columnName.trim();
boolean alreadyWrapped = columnName.startsWith("[") && columnName.endsWith("]");
if(alreadyWrapped) {
return lProtectedChar + columnName + rProtectedChar;
}
if(autoWrapColumnName) {
if(basicNamePattern.matcher(columnName).matches()) {
return lProtectedChar + columnName + rProtectedChar;
}
return "[" + columnName + "]";
}
return lProtectedChar + columnName + rProtectedChar;
}
}
public class AS400ELTManager extends AS400Manager {
public AS400ELTManager(String cid) {
@@ -4693,6 +4772,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class AccessELTManager extends AccessManager {
@@ -4705,6 +4788,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByBracketIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class DB2ELTManager extends DB2Manager {
@@ -4717,6 +4804,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class FirebirdELTManager extends FirebirdManager {
@@ -4729,6 +4820,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class HSQLDBELTManager extends HSQLDBManager {
@@ -4741,6 +4836,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class HiveELTManager extends HiveManager {
@@ -4753,6 +4852,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class InformixELTManager extends InformixManager {
@@ -4765,6 +4868,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class IngresELTManager extends IngresManager {
@@ -4777,6 +4884,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class VectorWiseELTManager extends VectorWiseManager {
@@ -4789,6 +4900,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class InterbaseELTManager extends InterbaseManager {
@@ -4801,6 +4916,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class JavaDBELTManager extends JavaDBManager {
@@ -4813,6 +4932,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class MaxDBELTManager extends MaxDBManager {
@@ -4825,6 +4948,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class MSSQLELTManager extends MSSQLManager {
@@ -4837,6 +4964,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByBracketIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class MysqlELTManager extends MysqlManager {
@@ -4849,6 +4980,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByGraveAccentIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class NetezzaELTManager extends NetezzaManager {
@@ -4861,6 +4996,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class OracleELTManager extends OracleManager {
@@ -4873,6 +5012,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class PostgrePlusELTManager extends PostgrePlusManager {
@@ -4885,6 +5028,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class GreenplumELTManager extends GreenplumManager {
@@ -4897,6 +5044,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class PostgreELTManager extends PostgreManager {
@@ -4909,6 +5060,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class RedshiftELTManager extends RedshiftManager {
@@ -4921,6 +5076,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class SQLiteELTManager extends SQLiteManager {
@@ -4933,6 +5092,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class SybaseELTManager extends SybaseManager {
@@ -4945,6 +5108,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class TeradataELTManager extends TeradataManager {
@@ -4957,6 +5124,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class VerticaELTManager extends VerticaManager {
@@ -4969,6 +5140,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class ExasolELTManager extends ExasolManager {
@@ -4981,6 +5156,10 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class SAPHanaELTManager extends SAPHanaManager {
@@ -4993,12 +5172,20 @@ public class CLASS {
protected String getRProtectedChar() {
return "";
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public class SnowflakeELTManager extends SnowflakeManager {
public SnowflakeELTManager(String cid) {
super(cid);
}
protected String getWrappedColumnName(String lProtectedChar, String columnName, String rProtectedChar) {
return ColumnHelper.wrapColumnNameByDoubleQuoteIfNecessary(autoWrapColumnName, lProtectedChar, columnName, rProtectedChar);
}
}
public Manager getELTManager(String dbmsId, String cid) {
@@ -5063,6 +5250,7 @@ public class CLASS {
((UnDefinedManager)manager).setDBMSId(dbmsId);
}
}
managerMap.put(dbmsId + cid, manager);
return manager;
}
@@ -5150,9 +5338,13 @@ public class CLASS {
return manager;
}
public Manager getELTManager(String dbmsId, String cid, INode node) {
public Manager getELTManager(String dbmsId, String cid, INode node, boolean autoWrapColumnName) {
Manager manager = getELTManager(dbmsId, cid);
//the manager have status, no issue for multi thread or no multi thread case?
manager.setNode(node);
manager.setAutoWrapColumnName(autoWrapColumnName);
return manager;
}

View File

@@ -596,7 +596,7 @@ Process.errorLoadingConnectionMessage=\u4EE5\u4E0B\u306E\u63A5\u7D9A\u306B\u79FB
Process.errorLoadingConnectionTitle=\u30B8\u30E7\u30D6\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
Process.metadataModificationDetected=\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u5909\u66F4\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F
Process.errorCircleConnectionDetected=\u30B5\u30FC\u30AF\u30EB\u63A5\u7D9A\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u63A5\u7D9A\u306F<{0}>\u3001\u30BD\u30FC\u30B9\u306F<{1}>\u3001\u30BF\u30FC\u30B2\u30C3\u30C8\u306F<{2}>\u3067\u3059\u3002
Process.Component.NotFound=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C1\u3064(\u307E\u305F\u306F\u8907\u6570)\u6B20\u843D\u3057\u3066\u3044\u307E\u3059: {0}\u3002Maven\u30B3\u30DE\u30F3\u30C9\u3067 -D{1}=false\u3092\u4F7F\u3046\u3068\u3053\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3059\u3002
Process.Components.NotFound={0}: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C1\u3064(\u307E\u305F\u306F\u8907\u6570)\u6B20\u843D\u3057\u3066\u3044\u307E\u3059: {1}\u3002Maven\u30B3\u30DE\u30F3\u30C9\u3067 -D{2}=false\u3092\u4F7F\u3046\u3068\u3053\u306E\u30C1\u30A7\u30C3\u30AF\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3059\u3002
ProcessUpdateManager.ReadOnlyProcessUpdateWarningMessages=\u3053\u306E\u30B8\u30E7\u30D6\u306F\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u304B\u3089\u66F4\u65B0\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u30B8\u30E7\u30D6\u304C\u8AAD\u307F\u53D6\u308A\u5C02\u7528\u306E\u5834\u5408\u306F\u66F4\u65B0\u3067\u304D\u307E\u305B\u3093\u3002
ProcessUpdateManager.Question=\u8CEA\u554F
ProcessUpdateManager.QuestionString=\u30B8\u30E7\u30D6\u3067\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u3088\u3046\u306B\u65B0\u898F\u30AB\u30E9\u30E0\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u304B?

View File

@@ -596,7 +596,7 @@ Process.errorLoadingConnectionMessage=\u5728\u540E\u9762\u7684\u8FDE\u63A5\u4E2D
Process.errorLoadingConnectionTitle=\u52A0\u8F7D\u4F5C\u4E1A\u7684\u65F6\u5019\u51FA\u73B0\u9519\u8BEF
Process.metadataModificationDetected=\u5143\u6570\u636E\u88AB\u4FEE\u6539
Process.errorCircleConnectionDetected=\u68C0\u6D4B\u5230\u5706\u5F62\u8FDE\u63A5\u3002\u8FDE\u63A5\u662F <{0}>\uFF0C\u6765\u6E90\u662F <{1}>\uFF0C\u76EE\u6807\u662F <{2}>\u3002
Process.Component.NotFound=\u7F3A\u5931\u4E00\u4E2A\u6216\u591A\u4E2A\u7EC4\u4EF6: {0}; \u5728 Maven \u547D\u4EE4\u4E2D\u4F7F\u7528 -D{1}=false \u53EF\u8DF3\u8FC7\u6B64\u9879\u68C0\u67E5\u3002
Process.Components.NotFound={0}\u7F3A\u5931\u4E00\u4E2A\u6216\u591A\u4E2A\u7EC4\u4EF6: {1}; \u5728 Maven \u547D\u4EE4\u4E2D\u4F7F\u7528 -D{2}=false \u53EF\u8DF3\u8FC7\u6B64\u9879\u68C0\u67E5\u3002
ProcessUpdateManager.ReadOnlyProcessUpdateWarningMessages=\u8FD9\u4E2A\u4F5C\u4E1A\u9700\u8981\u4ECE\u5E93\u4E2D\u66F4\u65B0\uFF0C\u4F46\u662F\u4F5C\u4E1A\u4E0D\u80FD\u4E3A\u53EA\u8BFB\u72B6\u6001\u3002
ProcessUpdateManager.Question=\u95EE\u9898
ProcessUpdateManager.QuestionString=\u5728\u4F5C\u4E1A\u4E2D\u5C06\u65B0\u5217\u8BBE\u5B9A\u4E3A\u201C\u5DF2\u4F7F\u7528\u201D\uFF1F

View File

@@ -591,7 +591,7 @@ public class ChangeMetadataCommand extends Command {
}
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDQComponentService.class)) {
final IDQComponentService service = (IDQComponentService) GlobalServiceRegister
final IDQComponentService service = GlobalServiceRegister
.getDefault()
.getService(IDQComponentService.class);
service.externalComponentInputMetadataChange(node, newInputMetadata, currentInputMetadata);
@@ -615,7 +615,7 @@ public class ChangeMetadataCommand extends Command {
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDQComponentService.class)) {
final IDQComponentService service =
(IDQComponentService) GlobalServiceRegister.getDefault().getService(IDQComponentService.class);
GlobalServiceRegister.getDefault().getService(IDQComponentService.class);
service.externalComponentOutputMetadataChange(node, newOutputMetadata, currentOutputMetadata);
}
MetadataToolHelper.copyTable(newOutputMetadata, currentOutputMetadata);
@@ -906,6 +906,9 @@ public class ChangeMetadataCommand extends Command {
changeTableNameParameter(newdbTableName, olddbTableName, uniqueName, dbTableElementField);
if (((Node) curNode).getComponent().getName().startsWith("tSAPADSO")) { //$NON-NLS-1$
IElementParameter serviceNameElementField = curNode.getElementParameter("SERVICE_NAME"); //$NON-NLS-1$
if (((Node) curNode).getComponent().getName().startsWith("tSAPADSOOutput")) {//$NON-NLS-1$
serviceNameElementField = curNode.getElementParameter("ADSO_NAME");//$NON-NLS-1$
}
changeTableNameParameter(newdbTableName, olddbTableName, uniqueName, serviceNameElementField);
}
if (((Node) curNode).isELTComponent()) {

View File

@@ -1422,7 +1422,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
param.setCategory(EComponentCategory.TECHNICAL);
String fieldName = pType.getField();
if (isActiveDatabase && fieldName == null) {
fieldName = EParameterFieldType.TEXT.getName();
fieldName = EParameterFieldType.CHECK.getName();
}
EParameterFieldType fieldType = null;
if (StringUtils.isNotBlank(fieldName)) {
@@ -2441,7 +2441,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
}
if (!unloadedNode.isEmpty()) {
if (CommonsPlugin.isScriptCmdlineMode() && !CommonsPlugin.isDevMode()) {
if (CommonsPlugin.isScriptCmdlineMode() && !CommonsPlugin.isDevMode() && !CommonsPlugin.isJunitWorking()) {
if (ERR_ON_COMPONENT_MISSING) {
StringBuilder missingComps = new StringBuilder();
try {

View File

@@ -131,7 +131,6 @@ import org.talend.designer.core.ui.editor.nodes.Node;
import org.talend.designer.core.ui.editor.update.UpdateCheckResult;
import org.talend.designer.core.ui.editor.update.UpdateManagerUtils;
import org.talend.designer.core.ui.preferences.TalendDesignerPrefConstants;
import org.talend.designer.core.utils.ConnectionUtil;
import org.talend.designer.core.utils.SAPParametersUtils;
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
import org.talend.repository.UpdateRepositoryUtils;
@@ -2190,6 +2189,24 @@ public class ProcessUpdateManager extends AbstractUpdateManager {
if (!sameValues) {
break;
}
} else if ("ENTRY_PROPERTIES".equals(param.getName()) && oldList != null //$NON-NLS-1$
&& objectValue instanceof List) {
List objectList = (List) objectValue;
if (oldList.size() != objectList.size()) {
sameValues = false;
} else {
for (int i = 0; i < oldList.size(); i++) {
Map<String, Object> oldMap = oldList.get(i);
Map<String, Object> objectMap = (Map<String, Object>) objectList.get(i);
if (oldMap.get("KEY").equals(objectMap.get("KEY")) //$NON-NLS-1$
&& oldMap.get("VALUE").equals(objectMap.get("VALUE"))) { //$NON-NLS-1$
sameValues = true;
} else {
sameValues = false;
break;
}
}
}
}
} else
// check the value

View File

@@ -77,7 +77,10 @@ public class GenerateCryptoFileController extends AbstractElementPropertySection
String passwordM1 =
removeQuotes(
service.getOriginalValue(node, ElementParameterParser.getValue(node, "__PASSWORD_M1__")));
String algoVersion =
removeQuotes(
service.getOriginalValue(node, ElementParameterParser.getValue(node, "__ALGO_VERSION__")));
boolean isParameterValidation = service.checkParameterValidation(cryptoFilePath, passwordM1);
if (!isParameterValidation) {
return;
@@ -100,7 +103,7 @@ public class GenerateCryptoFileController extends AbstractElementPropertySection
disp.syncExec(new Runnable() {
public void run() {
service.generateCryptoFile(passwordM1, cryptoMethod, cryptoFilePath);
service.generateCryptoFile(passwordM1, cryptoMethod, cryptoFilePath, Integer.parseInt(algoVersion));
}
});
}

View File

@@ -28,7 +28,6 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.talend.components.api.properties.ComponentProperties;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsHandler;
import org.talend.core.model.components.IComponentsService;
@@ -138,11 +137,7 @@ public class UnifiedComponentUtil {
for (IComponent component : componentList) {
String databaseName = service.getUnifiedCompDisplayName(service.getDelegateComponent(component),
component.getName());
if (StringUtils.isNotBlank(databaseName) && !databaseName.equals(dbTypeName)
&& (!EDatabaseTypeName.SYBASEASE.getDisplayName().equals(dbTypeName)
|| !EDatabaseTypeName.SYBASEASE.getXmlName().equals(databaseName))) {
// sybase can be dbType as database
// org.talend.designer.unifiedcomponent.unifier.sybase.SybaseComponentsUnifier
if (("JDBC".equals(databaseName) || isAdditionalJDBC(databaseName)) && !dbTypeName.equals(databaseName)) {
continue;
}

View File

@@ -172,7 +172,6 @@ public class DbMapComponent extends AbstractMapComponent {
if (activeDelimitedIdentifiersEP == null) {
activeDelimitedIdentifiersEP = new ElementParameter(origNode);
activeDelimitedIdentifiersEP.setShow(false);
activeDelimitedIdentifiersEP.setFieldType(EParameterFieldType.TEXT);
activeDelimitedIdentifiersEP.setName(EParameterName.ACTIVE_DATABASE_DELIMITED_IDENTIFIERS.getName());
activeDelimitedIdentifiersEP.setCategory(EComponentCategory.TECHNICAL);
activeDelimitedIdentifiersEP.setNumRow(99);
@@ -180,6 +179,7 @@ public class DbMapComponent extends AbstractMapComponent {
List<IElementParameter> elemParams = (List<IElementParameter>) origNode.getElementParameters();
elemParams.add(activeDelimitedIdentifiersEP);
}
activeDelimitedIdentifiersEP.setFieldType(EParameterFieldType.CHECK);
activeDelimitedIdentifiersEP.setValue(getGenerationManager().isUseDelimitedIdentifiers());
//

View File

@@ -199,9 +199,6 @@
<library
id="protobuf-java-2.5.0.jar">
</library>
<library
id="log4j-1.2.17.jar">
</library>
<library
id="slf4j-api-1.7.5.jar">
</library>
@@ -224,32 +221,6 @@
id="commons-io-2.4.jar">
</library>
</libraryNeededGroup>
<libraryNeededGroup
description="The lastest Pig libraries of MAPR50X"
id="PIG-BASE-LIB-MAPR50X_LASTEST"
name="PIG-BASE-LIB-MAPR50X_LASTEST">
<group
id="MAPREDUCE-LIB-MAPR50X_LASTEST">
</group>
<library
id="pig-withouthadoop-mapr-5.0.X-lastest">
</library>
<library
id="hadoop-hdfs-mapr-5.0.X-lastest">
</library>
<library
id="antlr-runtime-3.4.jar">
</library>
<library
id="automaton-1.11-8.jar">
</library>
<library
id="joda-time-2.3.jar">
</library>
<library
id="jline-1.0.jar">
</library>
</libraryNeededGroup>
<libraryNeededGroup
description="The lastest Map Reduce libraries of MAPR50X"
id="MAPREDUCE-LIB-MAPR50X_LASTEST"

View File

@@ -88,7 +88,7 @@ public abstract class AbstractJSONStepForm extends AbstractForm {
JSONConnectionContextHelper.openInConetxtModeDialog();
} else {
Map<ContextItem, List<ConectionAdaptContextVariableModel>> variableModels = JSONConnectionContextHelper
.exportAsContext(connectionItem, getConetxtParams());
.exportAsContext(connectionItem, getContextParams());
contextManager = JSONConnectionContextHelper.contextManager;
if (variableModels != null) {
@@ -101,11 +101,11 @@ public abstract class AbstractJSONStepForm extends AbstractForm {
Map<String, String> map = ((JobContextManager) contextManager).getNameMap();
// set properties for context mode
JSONConnectionContextHelper.setPropertiesForContextMode(connectionItem, contextItem,
getConetxtParams(), map);
getContextParams(), map);
}
} else {
// set properties for exist context
JSONConnectionContextHelper.setPropertiesForExistContextMode(connectionItem, getConetxtParams(),
JSONConnectionContextHelper.setPropertiesForExistContextMode(connectionItem, getContextParams(),
variableModels);
}
// refresh current UI.
@@ -144,9 +144,9 @@ public abstract class AbstractJSONStepForm extends AbstractForm {
* @see org.talend.repository.ui.swt.utils.AbstractForm#getConetxtParams()
*/
@Override
protected Set<IConnParamName> getConetxtParams() {
protected Set<IConnParamName> getContextParams() {
// TODO Auto-generated method stub
return super.getConetxtParams();
return super.getContextParams();
}
}

View File

@@ -3713,6 +3713,15 @@
name="ApplySecurityAfterAdvancedKafkaProperties"
version="8.0.1">
</projecttask>
<projecttask
beforeLogon="false"
breaks="8.0.0"
class="org.talend.repository.model.migration.RedshiftVersion2MigrationTask"
description="Change the Driver version to V1 for old Redshift job"
id="org.talend.repository.model.migration.RedshiftVersion2MigrationTask"
name="RedshiftVersion2MigrationTask"
version="8.0.1">
</projecttask>
<projecttask
beforeLogon="true"

View File

@@ -39,7 +39,7 @@ public class EncryptClientSecretMicrosoftCRMMigrationTask extends AbstractJobMig
public void transform(NodeType node) {
ElementParameterType client_secret = ComponentUtilities.getNodeProperty(node, "CLIENT_SECRET");
if ("TEXT".equals(client_secret.getField())) {
if (client_secret != null && "TEXT".equals(client_secret.getField())) {
client_secret.setField("PASSWORD");
try {

View File

@@ -0,0 +1,86 @@
package org.talend.repository.model.migration;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.components.ModifyComponentsAction;
import org.talend.core.model.components.conversions.IComponentConversion;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.migration.AbstractJobMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
public class RedshiftVersion2MigrationTask extends AbstractJobMigrationTask {
@Override public ExecutionResult execute(final Item item) {
final ProcessType processType = getProcessType(item);
if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {
return ExecutionResult.NOTHING_TO_DO;
}
String[] compNames = { "tRedshiftBulkExec","tRedshiftConnection","tRedshiftInput","tRedshiftOutput","tRedshiftOutputBulkExec","tRedshiftRow","tRedshiftUnload" }; //$NON-NLS-1$
IComponentConversion action = node -> {
if (node == null) {
return;
}
if (ComponentUtilities.getNodeProperty(node, "DRIVER_VERSION") == null ) {
ComponentUtilities.addNodeProperty(node, "DRIVER_VERSION", "CLOSED_LIST");//$NON-NLS-1$ //$NON-NLS-2$
ComponentUtilities.getNodeProperty(node, "DRIVER_VERSION")
.setValue("DRIVER_V1");//$NON-NLS-1$ //$NON-NLS-2$
}
};
IComponentConversion createTableAction = node -> {
if (node == null) {
return;
}
if (ComponentUtilities.getNodeProperty(node, "REDSHIFT_DRIVER_VERSION") == null ) {
ComponentUtilities.addNodeProperty(node, "REDSHIFT_DRIVER_VERSION", "CLOSED_LIST");//$NON-NLS-1$ //$NON-NLS-2$
ComponentUtilities.getNodeProperty(node, "REDSHIFT_DRIVER_VERSION")
.setValue("DRIVER_V1");//$NON-NLS-1$ //$NON-NLS-2$
}
};
boolean modified = false;
IComponentFilter createTableFilter = new NameComponentFilter("tCreateTable");
try {
modified |= ModifyComponentsAction.searchAndModify(item, processType, createTableFilter, Arrays.asList(createTableAction));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
for (String name : compNames) {
IComponentFilter filter = new NameComponentFilter(name);
try {
modified |= ModifyComponentsAction.searchAndModify(item, processType, filter, Arrays.asList(action));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
return modified ? ExecutionResult.SUCCESS_NO_ALERT : ExecutionResult.NOTHING_TO_DO;
}
@Override public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2022, Calendar.MARCH, 23, 0, 0, 0);
return gc.getTime();
}
}

View File

@@ -14,9 +14,15 @@ package org.talend.sdk.component.studio.update;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
@@ -25,6 +31,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -34,6 +41,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.m2e.core.MavenPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.runtime.service.ITaCoKitService;
import org.talend.commons.utils.resource.FileExtensions;
@@ -57,10 +66,19 @@ import org.talend.updates.runtime.storage.IFeatureStorage;
import org.talend.updates.runtime.utils.PathUtils;
import org.talend.utils.io.FilesUtils;
/**
* DOC cmeng class global comment. Detailled comment
*/
public class TaCoKitCarFeature extends AbstractExtraFeature implements ITaCoKitCarFeature {
private static final Logger LOGGER = LoggerFactory.getLogger(TaCoKitCarFeature.class);
private static final String JAVAW_CMD_EXE = "javaw.exe";
private static final String JAVA_CMD_EXE = "java.exe";
private static final String JAVA_CMD = "java";
private boolean autoReloadAfterInstalled = true;
@@ -158,25 +176,102 @@ public class TaCoKitCarFeature extends AbstractExtraFeature implements ITaCoKitC
return status;
}
private String getJavaCMD() {
String javacmd = "java";
public static String getJavaCMD() {
String vm = System.getProperty(EclipseCommandLine.PROP_VM);
if (!Platform.getOS().equals(Platform.OS_MACOSX) && !StringUtils.isBlank(vm)) {
if (!vm.endsWith(javacmd)) {
ExceptionHandler.logDebug("vm: " + vm);
if (vm.endsWith(".dll") || vm.endsWith(".so")) {
vm = Paths.get(vm).getParent().getParent().getParent().resolve("bin").toFile().getAbsolutePath();
if (!vm.endsWith(JAVA_CMD) || !vm.endsWith(JAVA_CMD_EXE)) {
LOGGER.info("vm: " + vm);
String javaCMD = Platform.getOS().equals(Platform.OS_WIN32) ? JAVA_CMD_EXE : JAVA_CMD;
Finder f = new Finder(javaCMD);
Path p = Paths.get(vm);
if (Files.isSymbolicLink(p)) {
try {
p = p.toRealPath();
} catch (IOException e) {
LOGGER.error("toRealPath error", e);
}
}
if (!vm.endsWith(File.separator)) {
vm = vm + File.separator;
findJava(Paths.get(vm), f);
if (f.getJavaFile() != null) {
return f.getJavaFile().getAbsolutePath();
}
vm = vm + javacmd;
}
return vm;
}
return javacmd;
return JAVA_CMD;
}
public static File findJava(Path p, Finder f) {
if (p == null) {
return null;
}
try {
Files.walkFileTree(p, f);
} catch (IOException e) {
LOGGER.error("findJava error", e);
}
if (f.getJavaFile() == null && f.getLevel() < 4) {
f.setLevel(f.getLevel() + 1);
findJava(p.getParent(), f);
}
return f.getJavaFile();
}
public static class Finder extends SimpleFileVisitor<Path> {
private final String javaCMD;
private File javaFile;
private int level = 0;
Finder(String javaCMD) {
this.javaCMD = javaCMD;
}
/**
* @return the level
*/
public int getLevel() {
return level;
}
/**
* @param level the level to set
*/
public void setLevel(int level) {
this.level = level;
}
public File getJavaFile() {
return javaFile;
}
// Invoke the pattern matching
// method on each file.
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
if (StringUtils.equals(javaCMD, FilenameUtils.getName(file.toFile().getName()))) {
javaFile = file.toFile();
return FileVisitResult.TERMINATE;
}
return FileVisitResult.CONTINUE;
}
// Invoke the pattern matching
// method on each directory.
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) {
LOGGER.error("vist " + file, exc);
return FileVisitResult.CONTINUE;
}
}
@SuppressWarnings("nls")
@@ -185,7 +280,7 @@ public class TaCoKitCarFeature extends AbstractExtraFeature implements ITaCoKitC
String installationPath = URIUtil.toFile(URIUtil.toURI(Platform.getInstallLocation().getURL())).getAbsolutePath();
String commandType = "studio-deploy";
List<String> cmds = new ArrayList<String>();
String javaCMD = this.getJavaCMD();
String javaCMD = getJavaCMD();
cmds.add(javaCMD);
cmds.add("-jar");
cmds.add(tckCarPath);

View File

@@ -86,10 +86,11 @@ public class UnifiedComponentUtilTest {
}
@Test
public void testFilterUnifiedComponent4Sybase() throws Exception {
public void testFilterUnifiedComponent4Filter() throws Exception {
ProxyRepositoryFactory proxyRepositoryFactory = ProxyRepositoryFactory.getInstance();
IRepositoryViewObject metadataRepObject = null;
try {
// sybase
Property metadataProperty = PropertiesFactory.eINSTANCE.createProperty();
DatabaseConnectionItem metadataItem = PropertiesFactory.eINSTANCE.createDatabaseConnectionItem();
ItemState metadataItemState = PropertiesFactory.eINSTANCE.createItemState();
@@ -133,10 +134,33 @@ public class UnifiedComponentUtilTest {
EDatabaseTypeName.SYBASEASE.getDisplayName());
boolean componentExist = isComponentExist(filterUnifiedComponent, "tSybaseOutputBulkExec");
assertTrue(componentExist);
componentExist = isComponentExist(filterUnifiedComponent, "tSybaseIQOutputBulkExec");
assertFalse(componentExist);
componentExist = isComponentExist(filterUnifiedComponent, "tDBOutputBulkExec");
assertTrue(componentExist);
// redshift
connection.setDatabaseType(EDatabaseTypeName.REDSHIFT.getDisplayName());
proxyRepositoryFactory.save(metadataItem);
metadataRepObject = proxyRepositoryFactory.getSpecificVersion(metadataProperty.getId(), metadataProperty.getVersion(),
true);
RepositoryNode metadataNode1 = new RepositoryNode(metadataRepObject, null, ENodeType.REPOSITORY_ELEMENT);
IComponentName rcSetting1 = RepositoryComponentManager.getSetting(metadataItem,
ERepositoryObjectType.METADATA_CONNECTIONS);
List<IComponent> neededComponents1 = RepositoryComponentManager.filterNeededComponents(metadataItem, metadataNode1,
ERepositoryObjectType.METADATA_CONNECTIONS, true, metadataRepObject.getProjectLabel());
RepositoryComponentSetting compsetting1 = new RepositoryComponentSetting();
compsetting1.setInputComponent(rcSetting1.getInputComponentName());
compsetting1.setOutputComponent(rcSetting1.getOutPutComponentName());
compsetting1.setDefaultComponent(rcSetting1.getDefaultComponentName());
List<IComponent> filterUnifiedComponent1 = UnifiedComponentUtil.filterUnifiedComponent(compsetting1,
neededComponents1, EDatabaseTypeName.REDSHIFT.getDisplayName());
componentExist = isComponentExist(filterUnifiedComponent1, "tRedshiftInput");
assertTrue(componentExist);
componentExist = isComponentExist(filterUnifiedComponent1, "tRedshiftOutput");
assertTrue(componentExist);
componentExist = isComponentExist(filterUnifiedComponent1, "tDBInput");
assertTrue(componentExist);
componentExist = isComponentExist(filterUnifiedComponent1, "tDBOutput");
assertTrue(componentExist);
} finally {
if (metadataRepObject != null) {
proxyRepositoryFactory.deleteObjectPhysical(metadataRepObject);

View File

@@ -14,6 +14,7 @@ package org.talend.designer.dbmap.managers;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
@@ -28,11 +29,14 @@ import org.talend.core.context.RepositoryContext;
import org.talend.core.model.components.ComponentCategory;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.process.EConnectionType;
import org.talend.core.model.process.ElementParameterParser;
import org.talend.core.model.process.IConnection;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.INodeConnector;
import org.talend.core.model.properties.PropertiesFactory;
import org.talend.core.model.properties.Property;
import org.talend.core.ui.component.ComponentsFactoryProvider;
import org.talend.designer.core.model.components.EParameterName;
import org.talend.designer.core.model.components.ElementParameter;
import org.talend.designer.core.model.components.NodeConnector;
import org.talend.designer.core.ui.editor.connections.Connection;
@@ -215,4 +219,39 @@ public class MapperManagerTest {
property.setVersion(VersionUtils.DEFAULT_VERSION);
return property;
}
@Test
public void testRestoreMapperModelFromInternalData() {
dbMapComponent.initialize();
dbMapComponent.setOriginalNode(targetNode);
dbMapComponent.restoreMapperModelFromInternalData();
String activeDelimited = ElementParameterParser.getValue(targetNode, "__ACTIVE_DATABASE_DELIMITED_IDENTIFIERS__");
String useAlias = ElementParameterParser.getValue(targetNode, "__USE_ALIAS_IN_OUTPUT_TABLE__");
assertTrue("false".equals(activeDelimited));
assertTrue("false".equals(useAlias));
IElementParameter activeDelimitedParam = targetNode
.getElementParameter(EParameterName.ACTIVE_DATABASE_DELIMITED_IDENTIFIERS.getName());
IElementParameter useAliasParam = targetNode.getElementParameter(EParameterName.USE_ALIAS_IN_OUTPUT_TABLE.getName());
activeDelimitedParam.setValue("true");
useAliasParam.setValue("true");
activeDelimited = ElementParameterParser.getValue(targetNode, "__ACTIVE_DATABASE_DELIMITED_IDENTIFIERS__");
useAlias = ElementParameterParser.getValue(targetNode, "__USE_ALIAS_IN_OUTPUT_TABLE__");
assertTrue("true".equals(activeDelimited));
assertTrue("true".equals(useAlias));
activeDelimitedParam.setValue(false);
useAliasParam.setValue(false);
activeDelimited = ElementParameterParser.getValue(targetNode, "__ACTIVE_DATABASE_DELIMITED_IDENTIFIERS__");
useAlias = ElementParameterParser.getValue(targetNode, "__USE_ALIAS_IN_OUTPUT_TABLE__");
assertTrue("false".equals(activeDelimited));
assertTrue("false".equals(useAlias));
activeDelimitedParam.setValue(true);
useAliasParam.setValue(true);
activeDelimited = ElementParameterParser.getValue(targetNode, "__ACTIVE_DATABASE_DELIMITED_IDENTIFIERS__");
useAlias = ElementParameterParser.getValue(targetNode, "__USE_ALIAS_IN_OUTPUT_TABLE__");
assertTrue("true".equals(activeDelimited));
assertTrue("true".equals(useAlias));
}
}

View File

@@ -0,0 +1,63 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.sdk.component.studio.util;
import org.eclipse.core.runtime.Platform;
import static org.junit.Assert.assertTrue;
import java.io.File;
import org.apache.commons.lang3.StringUtils;
import org.talend.commons.utils.system.EclipseCommandLine;
import org.talend.sdk.component.studio.update.TaCoKitCarFeature;
import org.junit.Test;
/**
* @author bhe created on Apr 8, 2022
*
*/
public class TaCokitCarFeatureTest {
@Test
public void testGetJavaCMD() throws Exception {
String vm = System.getProperty(EclipseCommandLine.PROP_VM);
// windows
if (Platform.getOS().equals(Platform.OS_WIN32)) {
if (!StringUtils.isEmpty(vm)) {
String javaCMD = TaCoKitCarFeature.getJavaCMD();
assertTrue(StringUtils.endsWith(javaCMD, "java.exe"));
assertTrue(new File(javaCMD).exists());
}
}
// linux
if (!Platform.getOS().equals(Platform.OS_WIN32)) {
if (!StringUtils.isEmpty(vm)) {
String javaCMD = TaCoKitCarFeature.getJavaCMD();
assertTrue(StringUtils.endsWith(javaCMD, "java"));
assertTrue(new File(javaCMD).exists());
}
}
}
}