Compare commits
10 Commits
vdrokov_fi
...
vdrokov_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f17d4a3ea9 | ||
|
|
e53ee0fe2e | ||
|
|
562018e483 | ||
|
|
03f01de063 | ||
|
|
123a1934e2 | ||
|
|
a38c309608 | ||
|
|
0eddc3b1b9 | ||
|
|
afe5d2e74b | ||
|
|
c3277931c1 | ||
|
|
5f1c19871c |
@@ -22,14 +22,14 @@ import org.talend.core.runtime.hd.hive.HiveMetadataHelper;
|
||||
*/
|
||||
public enum EImpalaDriver {
|
||||
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver"),
|
||||
IMPALA40("IMPALA40", "IMPALA40", "com.cloudera.impala.jdbc4.Driver"),
|
||||
IMPALA41("IMPALA41", "IMPALA41", "com.cloudera.impala.jdbc41.Driver");
|
||||
HIVE2("HIVE2", "HIVE2", "org.apache.hive.jdbc.HiveDriver", "doSupportHive2"),
|
||||
IMPALA("IMPALA", "IMPALA", "com.cloudera.impala.jdbc.Driver", "doSupportImpalaConnector");
|
||||
|
||||
EImpalaDriver(String displayName, String name, String driver) {
|
||||
EImpalaDriver(String displayName, String name, String driver, String supportDriverMethodName) {
|
||||
this.displayName = displayName;
|
||||
this.name = name;
|
||||
this.driver = driver;
|
||||
this.supportDriverMethodName = supportDriverMethodName;
|
||||
}
|
||||
|
||||
private String displayName;
|
||||
@@ -38,6 +38,8 @@ public enum EImpalaDriver {
|
||||
|
||||
private String driver;
|
||||
|
||||
private String supportDriverMethodName;
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
@@ -50,6 +52,10 @@ public enum EImpalaDriver {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getSupportDriverMethodName() {
|
||||
return supportDriverMethodName;
|
||||
}
|
||||
|
||||
public static boolean isSupport(String distribution, String version, boolean byDisplay, String supportMethodName) {
|
||||
return HiveMetadataHelper.doSupportMethod(distribution, version, byDisplay, supportMethodName);
|
||||
}
|
||||
@@ -57,7 +63,7 @@ public enum EImpalaDriver {
|
||||
public static String[] getImpalaDriverDisplay(String distribution, String version, boolean byDisplay) {
|
||||
List<String> list = new ArrayList<>(0);
|
||||
for (EImpalaDriver driver : EImpalaDriver.values()) {
|
||||
if (isSupport(distribution, version, byDisplay, "doSupportImpalaConnector")) {
|
||||
if (isSupport(distribution, version, byDisplay, driver.getSupportDriverMethodName())) {
|
||||
list.add(driver.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,8 +228,10 @@ public class DatabaseConnStrUtil {
|
||||
.get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
|
||||
}
|
||||
String url = null;
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal);
|
||||
String driver = dbConn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)
|
||||
|| template.startsWith(DbConnStrForHive.URL_IMPALA_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal, driver);
|
||||
}
|
||||
url = attachAdditionalHiveParameters(url, dbConn, false);
|
||||
return url;
|
||||
@@ -376,9 +378,13 @@ public class DatabaseConnStrUtil {
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal) {
|
||||
String s = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
String standardURlString = getImpalaURlString(s, supportContext, server, port, sid);
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal,
|
||||
String driver) {
|
||||
String template = EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
|
||||
if (EDatabaseTypeName.IMPALA.getDbType().equals(driver)) {
|
||||
template = EDatabaseConnTemplate.IMPALA_IMPALA_DRIVER.getUrlTemplate(null);
|
||||
}
|
||||
String standardURlString = getImpalaURlString(template, supportContext, server, port, sid);
|
||||
String principalSuffix = "principal="; //$NON-NLS-1$
|
||||
boolean hasPrinc = false;
|
||||
String[] urlArray = standardURlString.split(SEMICOLON);
|
||||
|
||||
@@ -30,6 +30,8 @@ public class DbConnStrForHive extends DbConnStr {
|
||||
|
||||
public static final String URL_HIVE_2_TEMPLATE = "jdbc:hive2://";//$NON-NLS-1$
|
||||
|
||||
public static final String URL_IMPALA_TEMPLATE = "jdbc:impala://";//$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC Marvin DbConnStrForHive constructor comment.
|
||||
*
|
||||
|
||||
@@ -214,6 +214,9 @@ public enum EDatabaseConnTemplate {
|
||||
IMPALA(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:hive2://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
IMPALA_IMPALA_DRIVER(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:impala://<host>:<port>/<sid>;auth=noSasl", //$NON-NLS-1$
|
||||
"21050", null, null, "localhost", "default")), //$NON-NLS-1$
|
||||
|
||||
HBASE(new DbConnStr(EDatabaseTypeName.HBASE, "127.0.0.1", //$NON-NLS-1$
|
||||
"2181")), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -281,9 +281,7 @@ public final class MetadataToolHelper {
|
||||
}
|
||||
|
||||
public static boolean isAllowSpecificCharacters() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
return coreUIPluginNode
|
||||
.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,8 +36,6 @@ import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.oro.text.regex.Perl5Substitution;
|
||||
import org.apache.oro.text.regex.Util;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
@@ -50,8 +48,7 @@ import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.services.IGenericDBService;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
@@ -617,8 +614,7 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
|
||||
private static boolean isAllowSpecificCharacters() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
return coreUIPluginNode.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
return CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
}
|
||||
|
||||
public static boolean isEmptyParameter(String source) {
|
||||
|
||||
@@ -428,7 +428,7 @@ public class NodeUtil {
|
||||
* @param node
|
||||
* @param type - node type to look for
|
||||
* @return
|
||||
*/
|
||||
*/
|
||||
public static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, String type) {
|
||||
if (type == null)
|
||||
return new ArrayList<IConnection>();
|
||||
@@ -451,9 +451,9 @@ public class NodeUtil {
|
||||
INode nextNode = connection.getSource();
|
||||
|
||||
if (!uniqueNamesDone.contains(nextNode.getUniqueName())) {
|
||||
uniqueNamesDone.add(nextNode.getUniqueName());
|
||||
uniqueNamesDone.add(nextNode.getUniqueName());
|
||||
|
||||
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
|
||||
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
|
||||
conns.add(connection);
|
||||
} else {
|
||||
conns.addAll(getFirstIncomingLineConnectionsOfType(nextNode, uniqueNamesDone, type)); // follow this way
|
||||
|
||||
@@ -126,6 +126,9 @@ public abstract class AbstractPropertyValueEvaluator implements PropertyValueEva
|
||||
}
|
||||
|
||||
if (GenericTypeUtils.isStringType(property)) {
|
||||
if (property.isFlag(Property.Flags.ENCRYPT)) {
|
||||
return TalendQuoteUtils.removeQuotes(stringValue);
|
||||
}
|
||||
return TalendQuoteUtils.removeQuotes(StringEscapeUtils.unescapeJava(stringValue));
|
||||
}
|
||||
return rawValue;
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.core.runtime.projectsetting;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.ProjectScope;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
@@ -27,6 +28,7 @@ import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.documentation.ERepositoryActionName;
|
||||
@@ -195,7 +197,19 @@ public class ProjectPreferenceManager {
|
||||
// return qulifierPreference.getBoolean(key, false);
|
||||
return getPreferenceStore().getBoolean(key);
|
||||
}
|
||||
|
||||
|
||||
public boolean isAllowSpecificCharacters() {
|
||||
String value = getValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
return Boolean.valueOf(value);
|
||||
}
|
||||
return false; // Default value
|
||||
}
|
||||
|
||||
public void setAllowSpecificCharacters(boolean isAllow) {
|
||||
setValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, isAllow);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the configurations.
|
||||
*/
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.preference;
|
||||
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
|
||||
public class SpecificSettingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
public SpecificSettingPreferencePage() {
|
||||
setPreferenceStore(CoreUIPlugin.getDefault().getPreferenceStore());
|
||||
setDescription("Specific settings");
|
||||
noDefaultAndApplyButton();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -32,8 +32,6 @@ public class SpecificSettingPreferencePage extends FieldEditorPreferencePage imp
|
||||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
addField(new BooleanFieldEditor(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,
|
||||
"Allow specific characters (UTF8,...) for columns of schemas", getFieldEditorParent()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.core.ui.preference.metadata;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
|
||||
@@ -27,8 +26,6 @@ public class MetadataPreferenceInitializer extends AbstractPreferenceInitializer
|
||||
public void initializeDefaultPreferences() {
|
||||
IPreferenceStore store = CoreUIPlugin.getDefault().getPreferenceStore();
|
||||
store.setDefault(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML, 500);
|
||||
store.setDefault(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -65,6 +71,10 @@
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -85,6 +85,12 @@
|
||||
<groupId>org.talend.components</groupId>
|
||||
<artifactId>components-salesforce-runtime</artifactId>
|
||||
<version>${components.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.components</groupId>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.21.0-SNAPSHOT</tacokit.components.version>
|
||||
<tacokit.components.version>1.22.0-SNAPSHOT</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
@@ -57,6 +57,12 @@
|
||||
<groupId>org.talend.components</groupId>
|
||||
<artifactId>cosmosDB</artifactId>
|
||||
<version>${tacokit.components.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-1.2.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.2.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.annotation-api-1.3.5.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/stax2-api-4.2.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/neethi-3.1.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.ws.rs-api-2.1.6.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.3.7.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.3.10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/javax.ws.rs-api-2.0-m10.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.bind-api-2.3.3.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.5.jar"/>
|
||||
|
||||
@@ -8,22 +8,22 @@ Bundle-ClassPath: .,
|
||||
lib/neethi-3.1.1.jar,
|
||||
lib/stax2-api-4.2.1.jar,
|
||||
lib/javax.activation-1.2.0.jar,
|
||||
lib/cxf-core-3.3.7.jar,
|
||||
lib/cxf-rt-bindings-xml-3.3.7.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-3.3.7.jar,
|
||||
lib/cxf-rt-rs-client-3.3.7.jar,
|
||||
lib/cxf-rt-transports-http-3.3.7.jar,
|
||||
lib/cxf-rt-wsdl-3.3.7.jar,
|
||||
lib/cxf-rt-bindings-soap-3.3.7.jar,
|
||||
lib/cxf-rt-databinding-jaxb-3.3.7.jar,
|
||||
lib/cxf-rt-features-clustering-3.3.7.jar,
|
||||
lib/cxf-rt-frontend-jaxws-3.3.7.jar,
|
||||
lib/cxf-rt-frontend-simple-3.3.7.jar,
|
||||
lib/cxf-rt-security-3.3.7.jar,
|
||||
lib/cxf-rt-security-saml-3.3.7.jar,
|
||||
lib/cxf-rt-ws-addr-3.3.7.jar,
|
||||
lib/cxf-rt-ws-policy-3.3.7.jar,
|
||||
lib/cxf-rt-ws-security-3.3.7.jar,
|
||||
lib/cxf-core-3.3.10.jar,
|
||||
lib/cxf-rt-bindings-xml-3.3.10.jar,
|
||||
lib/cxf-rt-frontend-jaxrs-3.3.10.jar,
|
||||
lib/cxf-rt-rs-client-3.3.10.jar,
|
||||
lib/cxf-rt-transports-http-3.3.10.jar,
|
||||
lib/cxf-rt-wsdl-3.3.10.jar,
|
||||
lib/cxf-rt-bindings-soap-3.3.10.jar,
|
||||
lib/cxf-rt-databinding-jaxb-3.3.10.jar,
|
||||
lib/cxf-rt-features-clustering-3.3.10.jar,
|
||||
lib/cxf-rt-frontend-jaxws-3.3.10.jar,
|
||||
lib/cxf-rt-frontend-simple-3.3.10.jar,
|
||||
lib/cxf-rt-security-3.3.10.jar,
|
||||
lib/cxf-rt-security-saml-3.3.10.jar,
|
||||
lib/cxf-rt-ws-addr-3.3.10.jar,
|
||||
lib/cxf-rt-ws-policy-3.3.10.jar,
|
||||
lib/cxf-rt-ws-security-3.3.10.jar,
|
||||
lib/jakarta.ws.rs-api-2.1.6.jar,
|
||||
lib/jakarta.annotation-api-1.3.5.jar,
|
||||
lib/woodstox-core-6.2.1.jar,
|
||||
|
||||
@@ -23,82 +23,82 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-core</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-bindings-xml</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-rs-client</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-wsdl</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-bindings-soap</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-databinding-jaxb</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-features-clustering</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-simple</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-security</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-security-saml</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-addr</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-policy</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-security</artifactId>
|
||||
<version>3.3.7</version>
|
||||
<version>3.3.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.talend.commons.ui.utils.PathUtils;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.EImpalaDriver;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
import org.talend.core.database.conn.template.DbConnStrForHive;
|
||||
@@ -1418,8 +1419,12 @@ public final class DBConnectionContextUtils {
|
||||
// Added 20130311 TDQ-7000, when it is context mode and not general jdbc, reset the url.
|
||||
String newURL = null;
|
||||
if (EDatabaseTypeName.IMPALA.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
|
||||
String template = DbConnStrForHive.URL_HIVE_2_TEMPLATE;
|
||||
if (EImpalaDriver.IMPALA.getName().equals(cloneConn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER))) {
|
||||
template = DbConnStrForHive.URL_IMPALA_TEMPLATE;
|
||||
}
|
||||
newURL = DatabaseConnStrUtil.getImpalaString(cloneConn, cloneConn.getServerName(), cloneConn.getPort(),
|
||||
cloneConn.getSID(), DbConnStrForHive.URL_HIVE_2_TEMPLATE);
|
||||
cloneConn.getSID(), template);
|
||||
} else {
|
||||
newURL = DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(), dbConn.getDbVersionString(), server, username,
|
||||
password, port, sidOrDatabase, filePath.toLowerCase(), datasource, dbRootPath, additionParam);
|
||||
|
||||
@@ -131,11 +131,8 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
if (EImpalaDriver.HIVE2.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.HIVE2.getDriver();
|
||||
}
|
||||
if (EImpalaDriver.IMPALA40.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA40.getDriver();
|
||||
}
|
||||
if (EImpalaDriver.IMPALA41.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA41.getDriver();
|
||||
if (EImpalaDriver.IMPALA.getDisplayName().equalsIgnoreCase(driverType)) {
|
||||
driverClass = EImpalaDriver.IMPALA.getDriver();
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("impala can not work with Hive1");
|
||||
@@ -165,14 +162,18 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
newThread.start();
|
||||
|
||||
Connection conn = null;
|
||||
String connectionInfo = new StringBuilder().append("JDBC Uri: ").append(metadataConn.getUrl()).append(" ").toString();
|
||||
try {
|
||||
conn = futureTask.get(getDBConnectionTimeout(), TimeUnit.SECONDS);
|
||||
if (conn == null) {
|
||||
throw new SQLException(connectionInfo);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
threadGroup.interrupt();
|
||||
addBackgroundJob(futureTask, newThread);
|
||||
throw new SQLException(Messages.getString("ImpalaConnectionManager.getConnection.timeout"), e); //$NON-NLS-1$
|
||||
throw new SQLException(connectionInfo + Messages.getString("ImpalaConnectionManager.getConnection.timeout"), e); //$NON-NLS-1$
|
||||
} catch (Throwable e1) {
|
||||
throw new SQLException(e1);
|
||||
throw new SQLException(connectionInfo, e1);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
@@ -151,9 +151,6 @@ import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.ui.dialog.AProgressMonitorDialogWithCancel;
|
||||
import org.talend.utils.sql.ConnectionUtils;
|
||||
|
||||
import com.ca.directory.jxplorer.editor.booleaneditor;
|
||||
import com.fasterxml.jackson.databind.node.BooleanNode;
|
||||
|
||||
/**
|
||||
* @author ocarbone
|
||||
*
|
||||
@@ -6436,10 +6433,16 @@ public class DatabaseForm extends AbstractForm {
|
||||
s = template;
|
||||
}
|
||||
} else if (isImpalaDBConnSelected()) {
|
||||
DatabaseConnection conn = getConnection();
|
||||
String template = DbConnStrForHive.URL_HIVE_2_TEMPLATE;
|
||||
s = DatabaseConnStrUtil.getImpalaString(getConnection(), getConnection().getServerName(), getConnection()
|
||||
.getPort(), getConnection().getSID(), template);
|
||||
getConnection().setUiSchema(getConnection().getSID());
|
||||
;
|
||||
String text = impalaDriverCombo.getText();
|
||||
if (EDatabaseTypeName.IMPALA.getDisplayName().equals(text)) {
|
||||
template = DbConnStrForHive.URL_IMPALA_TEMPLATE;
|
||||
}
|
||||
s = DatabaseConnStrUtil.getImpalaString(conn, conn.getServerName(), conn.getPort(), conn.getSID(), template);
|
||||
conn.setUiSchema(getConnection().getSID());
|
||||
// conn.setURL(s);
|
||||
} else {
|
||||
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(versionStr);
|
||||
if (version != null) {
|
||||
@@ -8387,12 +8390,12 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
|
||||
private void fillDefaultsWhenImpalaVersionChanged() {
|
||||
String distribution = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
|
||||
if (distribution == null) {
|
||||
return;
|
||||
}
|
||||
String version = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
|
||||
if (isCreation && isNeedFillDefaults()) {
|
||||
String distribution = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
|
||||
String version = getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
|
||||
if (distribution == null) {
|
||||
return;
|
||||
}
|
||||
EDatabaseConnTemplate template = EDatabaseConnTemplate.indexOfTemplate(getConnection().getDatabaseType());
|
||||
if (template != null) {
|
||||
portText.setText(template.getDefaultPort());
|
||||
@@ -8400,6 +8403,19 @@ public class DatabaseForm extends AbstractForm {
|
||||
sidOrDatabaseText.setText(template.getDefaultDB(null));
|
||||
}
|
||||
initImpalaInfo();
|
||||
} else {
|
||||
// when edit,change distribution will update impala driver
|
||||
IHadoopDistributionService hadoopService = getHadoopDistributionService();
|
||||
if (hadoopService != null) {
|
||||
IHDistribution impalaDistribution = hadoopService.getImpalaDistributionManager().getDistribution(distribution,
|
||||
false);
|
||||
IHDistributionVersion hdVersion = null;
|
||||
if (impalaDistribution != null) {
|
||||
hdVersion = impalaDistribution.getHDVersion(version, false);
|
||||
}
|
||||
// updateImpalaVersionPart(impalaDistribution);
|
||||
updateImpalaDriverAndMakeSelection(impalaDistribution, hdVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8535,9 +8551,9 @@ public class DatabaseForm extends AbstractForm {
|
||||
|
||||
protected void doImpalaDriverSelected() {
|
||||
if (!isContextMode()) {
|
||||
modifyFieldValue();
|
||||
getConnection().getParameters().put(ConnParameterKeys.IMPALA_DRIVER,
|
||||
EImpalaDriver.getByDisplay(impalaDriverCombo.getText()).getName());
|
||||
modifyFieldValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8682,7 +8698,7 @@ public class DatabaseForm extends AbstractForm {
|
||||
String impalaDriver = conn.getParameters().get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
if (impalaDriver != null) {
|
||||
EImpalaDriver driver = EImpalaDriver.getByName(impalaDriver);
|
||||
if (driver != null) {
|
||||
if (driver != null && Arrays.asList(impalaDriverDisplay).contains(impalaDriver)) {
|
||||
impalaDriverCombo.setText(driver.getDisplayName());
|
||||
} else {
|
||||
impalaDriverCombo.select(0);
|
||||
|
||||
@@ -422,9 +422,8 @@ public class DatabaseTableForm extends AbstractForm {
|
||||
|
||||
metadataEditor.setMetadataTable(metadataTable);
|
||||
|
||||
Boolean flag = CoreUIPlugin.getDefault().getPreferenceStore()
|
||||
.getBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
|
||||
if (!flag.booleanValue()) {
|
||||
boolean flag = CoreRuntimePlugin.getInstance().getProjectPreferenceManager().isAllowSpecificCharacters();
|
||||
if (!flag) {
|
||||
List<MetadataColumn> list = metadataEditor.getMetadataColumnList();
|
||||
for (MetadataColumn column : list) {
|
||||
if (!isCnorEn(column.getLabel())) {
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.cwm.helper.TaggedValueHelper;
|
||||
import org.talend.daikon.avro.AvroUtils;
|
||||
import org.talend.daikon.avro.SchemaConstants;
|
||||
@@ -237,8 +238,7 @@ public class MetadataToolAvroHelperTest {
|
||||
metadataTable.setSourceName("table1");
|
||||
Schema avroSchema = new Schema.Parser().parse((String) schemaObj);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
for (Schema.Field field : avroSchema.getFields()) {
|
||||
MetadataColumn metadataColumn = MetadataToolAvroHelper.convertFromAvro(field, metadataTable);
|
||||
metadataTable.getColumns().add(metadataColumn);
|
||||
@@ -321,7 +321,7 @@ public class MetadataToolAvroHelperTest {
|
||||
}
|
||||
}
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
metadataTable.setId("123456789");
|
||||
metadataTable.setName("table1");
|
||||
@@ -356,8 +356,7 @@ public class MetadataToolAvroHelperTest {
|
||||
metadataTable.setSourceName("table1");
|
||||
Schema avroSchema = new Schema.Parser().parse((String) schemaObj);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
for (Schema.Field field : avroSchema.getFields()) {
|
||||
MetadataColumn metadataColumn = MetadataToolAvroHelper.convertFromAvro(field, metadataTable);
|
||||
metadataTable.getColumns().add(metadataColumn);
|
||||
@@ -366,7 +365,7 @@ public class MetadataToolAvroHelperTest {
|
||||
assertTrue(metadataTable.getColumns().get(0).getLabel().equals("主鍵"));
|
||||
assertTrue(metadataTable.getColumns().get(1).getLabel().equals("名前"));
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
metadataTable.setId("123456789");
|
||||
metadataTable.setName("table1");
|
||||
@@ -453,8 +452,7 @@ public class MetadataToolAvroHelperTest {
|
||||
creatMetadataColumn.setTalendType("id_String");
|
||||
metadataTable.getColumns().add(creatMetadataColumn);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
org.apache.avro.Schema schema =MetadataToolAvroHelper.convertToAvro(metadataTable);
|
||||
String s = "{\"type\":\"record\",\"name\":\"table1\",\"fields\":["
|
||||
+ "{\"name\":\"_long\",\"type\":[\"string\",\"null\"],\"AVRO_TECHNICAL_KEY\":\"long\",\"di.column.talendType\":\"id_String\",\"talend.field.pattern\":\"\",\"di.table.label\":\"_long\",\"talend.field.precision\":\"0\",\"di.table.comment\":\"\",\"di.column.id\":\"111111\",\"talend.field.dbColumnName\":\"long\",\"di.column.isNullable\":\"true\",\"talend.field.length\":\"0\",\"di.column.relationshipType\":\"\",\"di.column.originalLength\":\"0\",\"di.column.relatedEntity\":\"\"},"
|
||||
@@ -467,7 +465,7 @@ public class MetadataToolAvroHelperTest {
|
||||
+ "\"di.table.comment\":\"\",\"di.table.name\":\"table1\",\"di.table.label\":\"table1\"}";
|
||||
assertTrue(schema.toString().equals(s));
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
schema =MetadataToolAvroHelper.convertToAvro(metadataTable);
|
||||
s = "{\"type\":\"record\",\"name\":\"table1\",\"fields\":["
|
||||
+ "{\"name\":\"_long\",\"type\":[\"string\",\"null\"],\"AVRO_TECHNICAL_KEY\":\"long\",\"di.column.talendType\":\"id_String\",\"talend.field.pattern\":\"\",\"di.table.label\":\"_long\",\"talend.field.precision\":\"0\",\"di.table.comment\":\"\",\"di.column.id\":\"111111\",\"talend.field.dbColumnName\":\"long\",\"di.column.isNullable\":\"true\",\"talend.field.length\":\"0\",\"di.column.relationshipType\":\"\",\"di.column.originalLength\":\"0\",\"di.column.relatedEntity\":\"\"},"
|
||||
|
||||
@@ -22,8 +22,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.junit.After;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -44,8 +42,6 @@ import org.talend.core.model.properties.ItemState;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.SAPConnectionItem;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.PackageHelper;
|
||||
@@ -244,8 +240,7 @@ public class MetadataToolHelperTest {
|
||||
*/
|
||||
@Test
|
||||
public void testValidateColumnName() {
|
||||
IEclipsePreferences preferences = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
preferences.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
|
||||
String columnName = MetadataToolHelper.validateColumnName("public", 0);
|
||||
assertEquals(columnName, "Column0");
|
||||
@@ -286,7 +281,7 @@ public class MetadataToolHelperTest {
|
||||
columnName = MetadataToolHelper.validateColumnName("_test_______________________t", 0);
|
||||
assertEquals("_test_______________________t", columnName);
|
||||
|
||||
preferences.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
|
||||
columnName = MetadataToolHelper.validateColumnName("你好", 0);
|
||||
assertEquals("你好", columnName);
|
||||
@@ -300,8 +295,7 @@ public class MetadataToolHelperTest {
|
||||
*/
|
||||
@Test
|
||||
public void testValidateTableName() {
|
||||
IEclipsePreferences preferences = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
preferences.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
|
||||
String tableName = "public";
|
||||
tableName = MetadataToolHelper.validateTableName(tableName);
|
||||
@@ -335,7 +329,7 @@ public class MetadataToolHelperTest {
|
||||
tableName = MetadataToolHelper.validateTableName(tableName);
|
||||
assertEquals(tableName, "t_ht01______2017");
|
||||
|
||||
preferences.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
|
||||
tableName = "t_ht01_处理日期_2017";
|
||||
tableName = MetadataToolHelper.validateTableName(tableName);
|
||||
@@ -659,8 +653,7 @@ public class MetadataToolHelperTest {
|
||||
creatMetadataColumn.getTaggedValue().add(tv);
|
||||
inputTable.getColumns().add(creatMetadataColumn);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
IMetadataTable targetTable = MetadataToolHelper.convert(inputTable);
|
||||
assertTrue(targetTable.getListColumns().get(0).getLabel().equals("_long"));
|
||||
assertTrue(targetTable.getListColumns().get(0).getOriginalDbColumnName().equals("long"));
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
@@ -104,8 +105,7 @@ public class ContextParameterUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testGetVariableFromCode4String() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode(""));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("abc"));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("123"));
|
||||
@@ -126,7 +126,7 @@ public class ContextParameterUtilsTest {
|
||||
Assert.assertEquals("Română", ContextParameterUtils.getVariableFromCode("context.Română"));
|
||||
Assert.assertEquals("русский", ContextParameterUtils.getVariableFromCode("context.русский"));
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.汉语"));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.日本語"));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.Ελληνική"));
|
||||
@@ -138,8 +138,7 @@ public class ContextParameterUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testGetVariableFromCode4Context() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
String var = ContextParameterUtils.getVariableFromCode("context.abc");
|
||||
Assert.assertEquals("abc", var);
|
||||
|
||||
@@ -275,7 +274,7 @@ public class ContextParameterUtilsTest {
|
||||
var = ContextParameterUtils.getVariableFromCode("context.русский-123");
|
||||
Assert.assertEquals("русский", var);
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.マイSQL"));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.汉语"));
|
||||
Assert.assertNull(ContextParameterUtils.getVariableFromCode("context.Ελληνική"));
|
||||
@@ -311,8 +310,7 @@ public class ContextParameterUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testIsValidParameterName() {
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
assertTrue(ContextParameterUtils.isValidParameterName("abc"));
|
||||
assertTrue(ContextParameterUtils.isValidParameterName("abc123"));
|
||||
assertTrue(ContextParameterUtils.isValidParameterName("abc_123"));
|
||||
@@ -330,7 +328,7 @@ public class ContextParameterUtilsTest {
|
||||
assertTrue(ContextParameterUtils.isValidParameterName("Română"));
|
||||
assertTrue(ContextParameterUtils.isValidParameterName("русский"));
|
||||
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, false);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(false);
|
||||
assertFalse(ContextParameterUtils.isValidParameterName("中文"));
|
||||
assertFalse(ContextParameterUtils.isValidParameterName("日本語"));
|
||||
assertFalse(ContextParameterUtils.isValidParameterName("Ελληνική"));
|
||||
|
||||
@@ -317,8 +317,7 @@ public class ConvertionHelperTest {
|
||||
newColumn.getAdditionalField().put("AVRO_TECHNICAL_KEY", "TEST1");
|
||||
source.getListColumns().add(newColumn);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
org.talend.core.model.metadata.builder.connection.MetadataTable metadataTable = ConvertionHelper.convert(source);
|
||||
assertTrue(metadataTable.getColumns().get(0).getLabel().equals("_long"));
|
||||
assertTrue(metadataTable.getColumns().get(0).getName().equals("long"));
|
||||
@@ -466,8 +465,7 @@ public class ConvertionHelperTest {
|
||||
creatMetadataColumn.getTaggedValue().add(tv);
|
||||
inputTable.getColumns().add(creatMetadataColumn);
|
||||
|
||||
IEclipsePreferences coreUIPluginNode = new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
|
||||
coreUIPluginNode.putBoolean(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS, true);
|
||||
CoreRuntimePlugin.getInstance().getProjectPreferenceManager().setAllowSpecificCharacters(true);
|
||||
IMetadataTable targetTable = MetadataToolHelper.convert(inputTable);
|
||||
assertTrue(targetTable.getListColumns().get(0).getLabel().equals("_long"));
|
||||
assertTrue(targetTable.getListColumns().get(0).getOriginalDbColumnName().equals("long"));
|
||||
|
||||
Reference in New Issue
Block a user