Search in sources :

Example 21 with BasicExpression

use of org.talend.hadoop.distribution.condition.BasicExpression in project tbd-studio-se by Talend.

the class EMR5290SparkStreamingSqlRowHiveNodeModuleGroup method getModuleGroups.

public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    DistributionModuleGroup dmg = new DistributionModuleGroup(EMR5290Constant.SPARK_HIVE_MRREQUIRED_MODULE_GROUP.getModuleName(), true, (ComponentCondition) new MultiComponentCondition(new SparkStreamingLinkedNodeCondition(distribution, version).getCondition(), BooleanOperator.AND, new BasicExpression("SQL_CONTEXT", EqualityOperator.EQ, "HiveContext")));
    hs.add(dmg);
    return hs;
}
Also used : SparkStreamingLinkedNodeCondition(org.talend.hadoop.distribution.condition.common.SparkStreamingLinkedNodeCondition) BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) MultiComponentCondition(org.talend.hadoop.distribution.condition.MultiComponentCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 22 with BasicExpression

use of org.talend.hadoop.distribution.condition.BasicExpression in project tbd-studio-se by Talend.

the class EMR5290SqoopModuleGroup method getModuleGroups.

public static Set<DistributionModuleGroup> getModuleGroups() {
    Set<DistributionModuleGroup> hs = new HashSet<>();
    hs.add(new DistributionModuleGroup(EMR5290Constant.SQOOP_MODULE_GROUP.getModuleName()));
    hs.add(new DistributionModuleGroup(EMR5290Constant.MAPREDUCE_MODULE_GROUP.getModuleName()));
    hs.add(new DistributionModuleGroup(EMR5290Constant.HDFS_MODULE_GROUP.getModuleName()));
    ComponentCondition parquetOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.PAQUET_OUTPUT_FORMAT));
    hs.add(new DistributionModuleGroup(EMR5290Constant.SQOOP_PARQUET_MODULE_GROUP.getModuleName(), true, parquetOutputCondition));
    return hs;
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) ComponentCondition(org.talend.hadoop.distribution.condition.ComponentCondition) DistributionModuleGroup(org.talend.hadoop.distribution.DistributionModuleGroup) HashSet(java.util.HashSet)

Example 23 with BasicExpression

use of org.talend.hadoop.distribution.condition.BasicExpression in project tbd-studio-se by Talend.

the class ExpressionTest method testGetExpressionString.

@Test
public void testGetExpressionString() throws Exception {
    Expression e1 = new BasicExpression(PARAM_1, VALUE_1, EqualityOperator.EQ);
    assertEquals(e1.getExpressionString(), LEFT_PAR + PARAM_1 + EQ + SINGLE_QUOTE + VALUE_1 + SINGLE_QUOTE + RIGHT_PAR);
    e1 = new BasicExpression(PARAM_1, VALUE_1, EqualityOperator.NOT_EQ);
    assertEquals(e1.getExpressionString(), LEFT_PAR + PARAM_1 + NEQ + SINGLE_QUOTE + VALUE_1 + SINGLE_QUOTE + RIGHT_PAR);
    e1 = new LinkedNodeExpression(SparkBatchConstant.SPARK_BATCH_SPARKCONFIGURATION_LINKEDPARAMETER, SparkBatchConstant.SPARK_BATCH_AZURE_SPARKCONFIGURATION_LINKEDPARAMETER, EqualityOperator.GE, ESparkVersion.SPARK_3_0.getSparkVersion());
    // $NON-NLS-1$
    assertEquals("(#LINK@NODE.SPARK_CONFIGURATION.STORAGE_CONFIGURATION ge 'SPARK_3_0_x')", e1.getExpressionString());
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression) Expression(org.talend.hadoop.distribution.condition.Expression) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression) Test(org.junit.Test)

Aggregations

BasicExpression (org.talend.hadoop.distribution.condition.BasicExpression)23 SimpleComponentCondition (org.talend.hadoop.distribution.condition.SimpleComponentCondition)20 MultiComponentCondition (org.talend.hadoop.distribution.condition.MultiComponentCondition)16 ComponentCondition (org.talend.hadoop.distribution.condition.ComponentCondition)15 HashSet (java.util.HashSet)13 DistributionModuleGroup (org.talend.hadoop.distribution.DistributionModuleGroup)11 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)5 Expression (org.talend.hadoop.distribution.condition.Expression)4 NestedComponentCondition (org.talend.hadoop.distribution.condition.NestedComponentCondition)4 ShowExpression (org.talend.hadoop.distribution.condition.ShowExpression)4 Set (java.util.Set)3 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 LinkedNodeExpression (org.talend.hadoop.distribution.condition.LinkedNodeExpression)2 RawExpression (org.talend.hadoop.distribution.condition.RawExpression)2 SparkBatchLinkedNodeCondition (org.talend.hadoop.distribution.condition.common.SparkBatchLinkedNodeCondition)2 SparkStreamingLinkedNodeCondition (org.talend.hadoop.distribution.condition.common.SparkStreamingLinkedNodeCondition)2 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 ComponentType (org.talend.hadoop.distribution.ComponentType)1