use of io.confluent.ksql.execution.expression.tree.BooleanLiteral in project ksql by confluentinc.
the class CreateSourceFactoryTest method shouldCreateStreamCommandWithSingleValueWrappingFromPropertiesNotConfig.
@Test
public void shouldCreateStreamCommandWithSingleValueWrappingFromPropertiesNotConfig() {
// Given:
ksqlConfig = new KsqlConfig(ImmutableMap.of(KsqlConfig.KSQL_WRAP_SINGLE_VALUES, true));
final ImmutableMap<String, Object> overrides = ImmutableMap.of(KsqlConfig.KSQL_WRAP_SINGLE_VALUES, true);
givenProperty(CommonCreateConfigs.WRAP_SINGLE_VALUE, new BooleanLiteral("false"));
final CreateStream statement = new CreateStream(SOME_NAME, ONE_KEY_ONE_VALUE, false, true, withProperties, false);
// When:
final CreateStreamCommand cmd = createSourceFactory.createStreamCommand(statement, ksqlConfig.cloneWithPropertyOverwrite(overrides));
// Then:
assertThat(cmd.getFormats().getValueFeatures(), is(SerdeFeatures.of(SerdeFeature.UNWRAP_SINGLES)));
}
use of io.confluent.ksql.execution.expression.tree.BooleanLiteral in project ksql by confluentinc.
the class CreateSourceFactoryTest method shouldCreateTableCommandWithSingleValueWrappingFromPropertiesNotConfig.
@Test
public void shouldCreateTableCommandWithSingleValueWrappingFromPropertiesNotConfig() {
// Given:
ksqlConfig = new KsqlConfig(ImmutableMap.of(KsqlConfig.KSQL_WRAP_SINGLE_VALUES, true));
final ImmutableMap<String, Object> overrides = ImmutableMap.of(KsqlConfig.KSQL_WRAP_SINGLE_VALUES, true);
givenProperty(CommonCreateConfigs.WRAP_SINGLE_VALUE, new BooleanLiteral("false"));
final CreateTable statement = new CreateTable(SOME_NAME, TABLE_ELEMENTS_1_VALUE, false, true, withProperties, false);
// When:
final CreateTableCommand cmd = createSourceFactory.createTableCommand(statement, ksqlConfig.cloneWithPropertyOverwrite(overrides));
// Then:
assertThat(cmd.getFormats().getValueFeatures(), is(SerdeFeatures.of(SerdeFeature.UNWRAP_SINGLES)));
}
Aggregations