use of org.apache.flink.table.operations.command.ResetOperation in project flink by apache.
the class SqlToOperationConverterTest method testReset.
@Test
public void testReset() {
Operation operation1 = parse("RESET", SqlDialect.DEFAULT);
assertThat(operation1).isInstanceOf(ResetOperation.class);
assertThat(((ResetOperation) operation1).getKey()).isNotPresent();
Operation operation2 = parse("RESET 'test-key'", SqlDialect.DEFAULT);
assertThat(operation2).isInstanceOf(ResetOperation.class);
assertThat(((ResetOperation) operation2).getKey()).isPresent();
assertThat(((ResetOperation) operation2).getKey()).hasValue("test-key");
}
use of org.apache.flink.table.operations.command.ResetOperation in project flink by apache.
the class ResetOperationParseStrategy method convert.
@Override
public Operation convert(String statement) {
Matcher matcher = pattern.matcher(statement.trim());
String key;
if (matcher.find()) {
key = matcher.group("key");
} else {
throw new TableException(String.format("Failed to convert the statement to RESET operation: %s.", statement));
}
return new ResetOperation(key);
}
Aggregations