Compare commits

...

12 Commits

Author SHA1 Message Date
apoltavtsev
ab37af74fe fix(APPINT-33907) Compile error for DemoRESTRoute when run in studio 2021-10-18 17:39:21 +02:00
sponomarova
8e09cbd65a feat(TBD-12137): Synapse GA (#4679) (#4683) 2021-10-18 11:44:33 +03:00
Xilai Dai
743d863776 (APPINT-33753) upgrade jsoup version (#4657) 2021-10-12 10:01:55 +08:00
jiezhang-tlnd
9a87e0c49e fix(TUP-33029)CVE: org.jsoup:jsoup:1.13.1 (#4664) 2021-10-12 09:59:48 +08:00
wang wei
78522294dc fix(TDI-46727): Cannot pass a global variable of type date to a spark subjob using tRunJob after R2021-06 (#4602) 2021-10-09 09:36:30 +08:00
Oleksandr Zhelezniak
2854fa80b5 chore: bump connectors 1.26.0 (#4652) 2021-10-08 15:24:22 +03:00
Emmanuel GALLOIS
7389610259 feat(TDI-46769): bump to component-runtime 1.37.0 (#4609) 2021-10-04 10:51:37 +02:00
zyuan-talend
ae319f0d85 fix(TUP-32857):add absent authentication parameters in mongodb metadata connection. (#4620) 2021-09-30 10:07:35 +08:00
sbliu
98a80d18b6 fix(TUP-32947): tELTOUTPUT: Concatenating context variables in the "Default schema" field not working. (#4612) 2021-09-28 16:39:38 +08:00
zyuan-talend
f878723f81 fix(TUP-32758):show in connection dropdown and keep the built-in while propertytype + db version are compatible.(#4594) 2021-09-26 15:04:50 +08:00
AlixMetivier
1ac0beea10 feat(TBD-12334): add run submit mode to dbr and wizard (#4569)
* feat(TBD-12334): add run submit mode to dbr and wizard

* wip

* wip

* Update ExtendedNodeConnectionContextUtils.java
2021-09-17 10:03:16 +02:00
hcyi
cc0cab9532 fix(TDI-46315):sap component and sap metadata have different module name/mvnurl.(#4567) 2021-09-14 14:54:29 +08:00
15 changed files with 307 additions and 7 deletions

View File

@@ -214,6 +214,36 @@ public class ConnParameterKeys {
/******************************************/
/*********** Azure Synapse keys ***************/
public static final String CONN_PARA_KEY_SYNAPSE_HOST = "CONN_PARA_KEY_SYNAPSE_HOST"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN = "CONN_PARA_KEY_SYNAPSE_AUTH_TOKEN"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_SPARK_POOLS = "CONN_PARA_KEY_SYNAPSE_SPARK_POOLS"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME = "CONN_PARA_KEY_SYNAPSE_FS_HOSTNAME"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_FS_CONTAINER = "CONN_PARA_KEY_SYNAPSE_FS_CONTAINER"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_FS_USERNAME = "CONN_PARA_KEY_SYNAPSE_FS_USERNAME"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_FS_PASSWORD = "CONN_PARA_KEY_SYNAPSE_FS_PASSWORD"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_FS_STORAGE = "CONN_PARA_KEY_SYNAPSE_FS_STORAGE"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB = "CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_DRIVER_MEMORY = "CONN_PARA_KEY_DRIVER_MEMORY"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_DRIVER_CORES = "CONN_PARA_KEY_DRIVER_CORES"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
/******************************************/
/**
* HBase keys.
*/
@@ -321,6 +351,8 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_DATABRICKS_ENDPOINT="CONN_PARA_KEY_DATABRICKS_ENDPOINT";
public static final String CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER = "CONN_PARA_KEY_DATABRICKS_CLOUD_PROVIDER";
public static final String CONN_PARA_KEY_DATABRICKS_RUN_MODE = "CONN_PARA_KEY_DATABRICKS_RUN_MODE";
public static final String CONN_PARA_KEY_DATABRICKS_CLUSTER_ID="CONN_PARA_KEY_DATABRICKS_CLUSTER_ID";

View File

@@ -101,22 +101,59 @@ public enum EHadoopProperties {
HD_AZURE_DEPLOYBOLB,
HD_JOB_RESULT_FOLDER,
SYNAPSE_ENDPOINT,
SYNAPSE_TOKEN,
SPARK_POOL_NAME,
SYNAPSE_STORAGE_HOST,
SYNAPSE_STORAGE_CONTAINER,
SYNAPSE_STORAGE_USERNAME,
SYNAPSE_STORAGE_PASSWORD,
DEPLOY_FOLDER,
SPARK_DRIVER_MEM,
SPARK_DRIVER_CORES,
SPARK_EXECUTOR_MEMORY,
QUBOLE_API_TOKEN,
QUBOLE_CLUSTER,
QUBOLE_CLUSTER_LABEL,
QUBOLE_ENDPOINT,
QUBOLE_ENDPOINT_URL,
QUBOLE_S3_ACCESS_KEY,
QUBOLE_S3_SECRET_KEY,
QUBOLE_S3_BUCKET_NAME,
QUBOLE_S3_BUCKET_KEY,
QUBOLE_S3_REGION,
DATABRICKS_ENDPOINT,
DATABRICKS_CLOUD_PROVIDER,
DATABRICKS_RUN_MODE,
DATABRICKS_CLUSTER_ID,
DATABRICKS_TOKEN,
DATABRICKS_DBFS_DEP_FOLDER;
public String getName() {

View File

@@ -34,6 +34,8 @@ public enum EHadoopDistributions {
PIVOTAL_HD("Pivotal HD"), //$NON-NLS-1$
MICROSOFT_HD_INSIGHT("Microsoft HD Insight"), //$NON-NLS-1$
AZURE_SYNAPSE("Azure Synapse Runtime for Apache Spark 3.0"), //$NON-NLS-1$
GOOGLE_CLOUD_DATAPROC("Google Cloud Dataproc"), //$NON-NLS-1$

View File

@@ -0,0 +1,73 @@
// ============================================================================
//
// Copyright (C) 2006-2020 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.core.hadoop.version;
import java.util.ArrayList;
import java.util.List;
public enum ESynapseStorage {
ADLS_GEN2("ADLS Gen2"); //$NON-NLS-1$
private String displayName;
ESynapseStorage(String displayName) {
this.displayName = displayName;
}
public String getName() {
return name();
}
public String getDisplayName() {
return this.displayName;
}
public static List<String> getAllSynapseStorageDisplayNames() {
return getAllSynapseStorageNames(true);
}
public static List<String> getAllSynapseStorageNames(boolean display) {
List<String> names = new ArrayList<String>();
ESynapseStorage[] values = values();
for (ESynapseStorage storage : values) {
if (display) {
names.add(storage.getDisplayName());
} else {
names.add(storage.getName());
}
}
return names;
}
public static ESynapseStorage getSynapseStoragenByDisplayName(String name) {
return getSynapseStorageByName(name, true);
}
public static ESynapseStorage getSynapseStorageByName(String name, boolean display) {
if (name != null) {
for (ESynapseStorage storage : values()) {
if (display) {
if (name.equalsIgnoreCase(storage.getDisplayName())) {
return storage;
}
} else {
if (name.equalsIgnoreCase(storage.getName())) {
return storage;
}
}
}
}
return null;
}
}

View File

@@ -16,8 +16,8 @@ package org.talend.core.model.metadata.designerproperties;
* DOC talend class global comment. Detailled comment
*/
public enum SapJcoVersion {
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$
SAP3("sap jco 3.*", "sapjco3.jar");//$NON-NLS-1$
SAP2("sap jco 2.*", "sapjco.jar"), //$NON-NLS-1$ //$NON-NLS-2$
SAP3("sap jco 3.*", "com.sap.conn.jco.sapjco.jar");//$NON-NLS-1$ //$NON-NLS-2$
private String displayName;

View File

@@ -1492,4 +1492,29 @@ public class NodeUtil {
}
return false;
}
/**
* TUP-32758:Used to judge if two components are compatible from name
* for example tAmazonMysqlConnection and tMysqlConnection ,tAmazonOracleCommit and tOracleCommit
*/
public static boolean isCompatibleByName(String componentName1, String componentName2) {
boolean isCompatable = false;
if ( componentName1 ==null || componentName2 == null
|| componentName1.length()<1 || componentName2.length() < 1) return false;
if (componentName1.replaceFirst("t", "tAmazon").equals(componentName2) ||
componentName2.replaceFirst("t", "tAmazon").equals(componentName1)) {
isCompatable = true;
}
return isCompatable;
}
public static boolean isDatabaseFamily(String orginalFamilyName) {
boolean isDatabaseFamily = false;
String rootFamily = "";
rootFamily = orginalFamilyName != null ? orginalFamilyName.split("/")[0] : "";
if (rootFamily.equals("Databases")) {
isDatabaseFamily = true;
}
return isDatabaseFamily;
}
}

View File

@@ -264,6 +264,40 @@ public final class TalendQuoteUtils {
}
}
public static boolean isStartEndsWithQuotation(String expression, boolean checkStart, boolean checkEnd) {
if (StringUtils.isBlank(expression)) {
return false;
}
boolean startsWith = false;
boolean endsWith = false;
ECodeLanguage language = LanguageManager.getCurrentLanguage();
switch (language) {
case JAVA:
startsWith = expression.startsWith(QUOTATION_MARK);
endsWith = expression.endsWith(QUOTATION_MARK);
if (checkStart && checkEnd) {
return startsWith & endsWith;
} else if (checkStart) {
return startsWith;
} else if (checkEnd) {
return endsWith;
}
default: // PERL
startsWith = expression.startsWith(SINGLE_QUOTE);
endsWith = expression.endsWith(SINGLE_QUOTE);
if (checkStart && checkEnd) {
return startsWith & endsWith;
} else if (checkStart) {
return startsWith;
} else if (checkEnd) {
return endsWith;
}
}
return false;
}
public static String removeQuotes(String text, String quotation) {
if (text == null) {
return null;

View File

@@ -54,6 +54,17 @@
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagon.version}</version>
<exclusions>
<exclusion>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>

View File

@@ -35,6 +35,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
<exclusion>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -94,6 +98,11 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.25.0</tacokit.components.version>
<tacokit.components.version>1.26.0</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.36.1</tcomp.version>
<tcomp.version>1.37.0</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
</properties>

View File

@@ -12,6 +12,7 @@
// ============================================================================
package routines.system;
import java.text.ParseException;
import java.util.Date;
import routines.TalendDate;
@@ -31,6 +32,8 @@ public class RuntimeUtils {
public static String getRuntimeType(Object o) {
return o.getClass().getName();
}
private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
/**
* This function is in order to check the Date type in tRunJob when transmit the context to child job.
@@ -45,11 +48,40 @@ public class RuntimeUtils {
// when tRunJob transmit the date to child job, it should format with "yyyy-MM-dd HH:mm:ss"
if (isDateType(o)) {
return TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", (Date) o); //$NON-NLS-1$
return TalendDate.formatDate(DEFAULT_DATE_PATTERN, (Date) o); //$NON-NLS-1$
}
return o;
}
public static Date getDate(String pattern, String dateString) {
if (dateString == null || dateString.isEmpty()) {
return null;
}
// when tRunJob transmit the date to child job:
//case 1: pass date string with pattern : yyyy-MM-dd HH:mm:ss
//case 2: pass date long value
//so here process two cases both and avoid exception
try {
return new java.text.SimpleDateFormat(pattern).parse(dateString);
} catch(ParseException e) {
//ignore exception
}
try {
return new Date(Long.valueOf(dateString));
} catch(NumberFormatException e) {
//ignore exception
//System.err.println(String.format("Null value will be used for context parameter as can't parse this to date: %s", dateString));
}
return null;
}
public static Date getDate(String dateString) {
return getDate(DEFAULT_DATE_PATTERN, dateString);
}
public static void main(String[] args) {
int i = 10;

View File

@@ -820,6 +820,8 @@ public class ModulesNeededProvider {
IMPORTType importType = ComponentFactory.eINSTANCE.createIMPORTType();
importType.setMODULEGROUP("esb-java-11-group");
importType.setREQUIRED(true);
collectModuleNeeded("tRESTClient", importType, importNeedsListForRoutes);
}
/**

View File

@@ -45,6 +45,11 @@ public class ExtendedNodeConnectionContextUtils {
ReplicaSets,
ReplicaHost,
ReplicaPort,
AuthenticationDatabase,
UserPrincipal,
Realm,
KDCServer,
// Hadoop standard param
NameNodeUri,
@@ -84,6 +89,20 @@ public class ExtendedNodeConnectionContextUtils {
KeyAzuresUser,
KeyAzurePassword,
KeyAzureDeployBlob,
// Azure Synapse param
SynapseHostName,
SynapseAuthToken,
SynapseSparkPools,
SynapseFsHostName,
SynapseFsContainer,
SynapseFsUserName,
SynapseFsPassword,
SynapseDeployBlob,
SynapseDriverMemory,
SynapseDriverCores,
SynapseExecutorMemory,
UseTuningProperties,
// Hcatalog param
HCatalogHostName,
@@ -135,6 +154,7 @@ public class ExtendedNodeConnectionContextUtils {
// DataBricks
DataBricksEndpoint,
DatabricksRunMode,
DataBricksCloudProvider,
DataBricksClusterId,
DataBricksToken,

View File

@@ -12,7 +12,9 @@
// ============================================================================
package org.talend.core.utils;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Assert;
import org.junit.Test;
@@ -247,4 +249,25 @@ public class TalendQuoteUtilsTest {
assertTrue("\"abcd\"".equals(resultStr));
}
@Test
public void testIsStartEndsWithQuotation() {
String text = "\"prefix_\"+context.db+\".\"+context.schema+\"_suffix\"";
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, false));
text = "\"prefix_\"+context.db+\".\"+context.schema";
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
text = "context.db+\".\"+context.schema+\"_suffix\"";
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
assertTrue(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
text = "context.db+\".\"+context.schema";
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, true));
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, true, false));
assertFalse(TalendQuoteUtils.isStartEndsWithQuotation(text, false, true));
}
}