Search in sources :

Example 1 with SqlTableLikeOption

use of org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption in project flink by apache.

the class MergeTableLikeUtilTest method includingAllOverwriteOptionsMergeStrategyExpansion.

@Test
public void includingAllOverwriteOptionsMergeStrategyExpansion() {
    List<SqlTableLikeOption> inputOptions = Arrays.asList(new SqlTableLikeOption(MergingStrategy.EXCLUDING, FeatureOption.ALL), new SqlTableLikeOption(MergingStrategy.INCLUDING, FeatureOption.CONSTRAINTS));
    Map<FeatureOption, MergingStrategy> mergingStrategies = util.computeMergingStrategies(inputOptions);
    assertThat(mergingStrategies.get(FeatureOption.OPTIONS), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.PARTITIONS), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.CONSTRAINTS), is(MergingStrategy.INCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.GENERATED), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.METADATA), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.WATERMARKS), is(MergingStrategy.EXCLUDING));
}
Also used : FeatureOption(org.apache.flink.sql.parser.ddl.SqlTableLike.FeatureOption) SqlTableLikeOption(org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption) MergingStrategy(org.apache.flink.sql.parser.ddl.SqlTableLike.MergingStrategy) Test(org.junit.Test)

Example 2 with SqlTableLikeOption

use of org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption in project flink by apache.

the class MergeTableLikeUtilTest method includingAllMergeStrategyExpansion.

@Test
public void includingAllMergeStrategyExpansion() {
    List<SqlTableLikeOption> inputOptions = Collections.singletonList(new SqlTableLikeOption(MergingStrategy.INCLUDING, FeatureOption.ALL));
    Map<FeatureOption, MergingStrategy> mergingStrategies = util.computeMergingStrategies(inputOptions);
    assertThat(mergingStrategies.get(FeatureOption.OPTIONS), is(MergingStrategy.INCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.PARTITIONS), is(MergingStrategy.INCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.CONSTRAINTS), is(MergingStrategy.INCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.GENERATED), is(MergingStrategy.INCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.WATERMARKS), is(MergingStrategy.INCLUDING));
}
Also used : FeatureOption(org.apache.flink.sql.parser.ddl.SqlTableLike.FeatureOption) SqlTableLikeOption(org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption) MergingStrategy(org.apache.flink.sql.parser.ddl.SqlTableLike.MergingStrategy) Test(org.junit.Test)

Example 3 with SqlTableLikeOption

use of org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption in project flink by apache.

the class MergeTableLikeUtilTest method excludingAllMergeStrategyExpansion.

@Test
public void excludingAllMergeStrategyExpansion() {
    List<SqlTableLikeOption> inputOptions = Collections.singletonList(new SqlTableLikeOption(MergingStrategy.EXCLUDING, FeatureOption.ALL));
    Map<FeatureOption, MergingStrategy> mergingStrategies = util.computeMergingStrategies(inputOptions);
    assertThat(mergingStrategies.get(FeatureOption.OPTIONS), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.PARTITIONS), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.CONSTRAINTS), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.GENERATED), is(MergingStrategy.EXCLUDING));
    assertThat(mergingStrategies.get(FeatureOption.WATERMARKS), is(MergingStrategy.EXCLUDING));
}
Also used : FeatureOption(org.apache.flink.sql.parser.ddl.SqlTableLike.FeatureOption) SqlTableLikeOption(org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption) MergingStrategy(org.apache.flink.sql.parser.ddl.SqlTableLike.MergingStrategy) Test(org.junit.Test)

Aggregations

FeatureOption (org.apache.flink.sql.parser.ddl.SqlTableLike.FeatureOption)3 MergingStrategy (org.apache.flink.sql.parser.ddl.SqlTableLike.MergingStrategy)3 SqlTableLikeOption (org.apache.flink.sql.parser.ddl.SqlTableLike.SqlTableLikeOption)3 Test (org.junit.Test)3