Java Code Examples for org.apache.flink.table.descriptors.DescriptorProperties#withoutKeys()

The following examples show how to use org.apache.flink.table.descriptors.DescriptorProperties#withoutKeys() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableEntry.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static TableEntry create(DescriptorProperties properties) {
	properties.validateString(TABLES_NAME, false, 1);
	properties.validateEnumValues(
		TABLES_TYPE,
		false,
		Arrays.asList(
			TABLES_TYPE_VALUE_SOURCE,
			TABLES_TYPE_VALUE_SOURCE_TABLE,
			TABLES_TYPE_VALUE_SINK,
			TABLES_TYPE_VALUE_SINK_TABLE,
			TABLES_TYPE_VALUE_BOTH,
			TABLES_TYPE_VALUE_SOURCE_SINK_TABLE,
			TABLES_TYPE_VALUE_VIEW,
			TABLES_TYPE_VALUE_TEMPORAL_TABLE));

	final String name = properties.getString(TABLES_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Arrays.asList(TABLES_NAME, TABLES_TYPE));

	switch (properties.getString(TABLES_TYPE)) {
		case TABLES_TYPE_VALUE_SOURCE:
		case TABLES_TYPE_VALUE_SOURCE_TABLE:
			return new SourceTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_SINK:
		case TABLES_TYPE_VALUE_SINK_TABLE:
			return new SinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_BOTH:
		case TABLES_TYPE_VALUE_SOURCE_SINK_TABLE:
			return new SourceSinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_VIEW:
			return new ViewEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_TEMPORAL_TABLE:
			return new TemporalTableEntry(name, cleanedProperties);
		default:
			throw new SqlClientException("Unexpected table type.");
	}
}
 
Example 2
Source File: TableEntry.java    From flink with Apache License 2.0 5 votes vote down vote up
private static TableEntry create(DescriptorProperties properties) {
	properties.validateString(TABLES_NAME, false, 1);
	properties.validateEnumValues(
		TABLES_TYPE,
		false,
		Arrays.asList(
			TABLES_TYPE_VALUE_SOURCE,
			TABLES_TYPE_VALUE_SOURCE_TABLE,
			TABLES_TYPE_VALUE_SINK,
			TABLES_TYPE_VALUE_SINK_TABLE,
			TABLES_TYPE_VALUE_BOTH,
			TABLES_TYPE_VALUE_SOURCE_SINK_TABLE,
			TABLES_TYPE_VALUE_VIEW,
			TABLES_TYPE_VALUE_TEMPORAL_TABLE));

	final String name = properties.getString(TABLES_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Arrays.asList(TABLES_NAME, TABLES_TYPE));

	switch (properties.getString(TABLES_TYPE)) {
		case TABLES_TYPE_VALUE_SOURCE:
		case TABLES_TYPE_VALUE_SOURCE_TABLE:
			return new SourceTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_SINK:
		case TABLES_TYPE_VALUE_SINK_TABLE:
			return new SinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_BOTH:
		case TABLES_TYPE_VALUE_SOURCE_SINK_TABLE:
			return new SourceSinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_VIEW:
			return new ViewEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_TEMPORAL_TABLE:
			return new TemporalTableEntry(name, cleanedProperties);
		default:
			throw new SqlClientException("Unexpected table type.");
	}
}
 
Example 3
Source File: TableEntry.java    From flink with Apache License 2.0 5 votes vote down vote up
private static TableEntry create(DescriptorProperties properties) {
	properties.validateString(TABLES_NAME, false, 1);
	properties.validateEnumValues(
		TABLES_TYPE,
		false,
		Arrays.asList(
			TABLES_TYPE_VALUE_SOURCE,
			TABLES_TYPE_VALUE_SOURCE_TABLE,
			TABLES_TYPE_VALUE_SINK,
			TABLES_TYPE_VALUE_SINK_TABLE,
			TABLES_TYPE_VALUE_BOTH,
			TABLES_TYPE_VALUE_SOURCE_SINK_TABLE,
			TABLES_TYPE_VALUE_VIEW,
			TABLES_TYPE_VALUE_TEMPORAL_TABLE));

	final String name = properties.getString(TABLES_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Arrays.asList(TABLES_NAME, TABLES_TYPE));

	switch (properties.getString(TABLES_TYPE)) {
		case TABLES_TYPE_VALUE_SOURCE:
		case TABLES_TYPE_VALUE_SOURCE_TABLE:
			return new SourceTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_SINK:
		case TABLES_TYPE_VALUE_SINK_TABLE:
			return new SinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_BOTH:
		case TABLES_TYPE_VALUE_SOURCE_SINK_TABLE:
			return new SourceSinkTableEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_VIEW:
			return new ViewEntry(name, cleanedProperties);
		case TABLES_TYPE_VALUE_TEMPORAL_TABLE:
			return new TemporalTableEntry(name, cleanedProperties);
		default:
			throw new SqlClientException("Unexpected table type.");
	}
}
 
Example 4
Source File: FunctionEntry.java    From Flink-CEPplus with Apache License 2.0 3 votes vote down vote up
private static FunctionEntry create(DescriptorProperties properties) {
	properties.validateString(FUNCTIONS_NAME, false, 1);

	final String name = properties.getString(FUNCTIONS_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(FUNCTIONS_NAME));

	return new FunctionEntry(name, cleanedProperties);
}
 
Example 5
Source File: FunctionEntry.java    From flink with Apache License 2.0 3 votes vote down vote up
private static FunctionEntry create(DescriptorProperties properties) {
	properties.validateString(FUNCTIONS_NAME, false, 1);

	final String name = properties.getString(FUNCTIONS_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(FUNCTIONS_NAME));

	return new FunctionEntry(name, cleanedProperties);
}
 
Example 6
Source File: CatalogEntry.java    From flink with Apache License 2.0 3 votes vote down vote up
private static CatalogEntry create(DescriptorProperties properties) {
	properties.validateString(CATALOG_NAME, false, 1);

	final String name = properties.getString(CATALOG_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(CATALOG_NAME));

	return new CatalogEntry(name, cleanedProperties);
}
 
Example 7
Source File: FunctionEntry.java    From flink with Apache License 2.0 3 votes vote down vote up
private static FunctionEntry create(DescriptorProperties properties) {
	properties.validateString(FUNCTIONS_NAME, false, 1);

	final String name = properties.getString(FUNCTIONS_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(FUNCTIONS_NAME));

	return new FunctionEntry(name, cleanedProperties);
}
 
Example 8
Source File: ModuleEntry.java    From flink with Apache License 2.0 3 votes vote down vote up
private static ModuleEntry create(DescriptorProperties properties) {
	properties.validateString(MODULE_NAME, false, 1);

	final String name = properties.getString(MODULE_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(MODULE_NAME));

	return new ModuleEntry(name, cleanedProperties);
}
 
Example 9
Source File: CatalogEntry.java    From flink with Apache License 2.0 3 votes vote down vote up
private static CatalogEntry create(DescriptorProperties properties) {
	properties.validateString(CATALOG_NAME, false, 1);

	final String name = properties.getString(CATALOG_NAME);

	final DescriptorProperties cleanedProperties =
		properties.withoutKeys(Collections.singletonList(CATALOG_NAME));

	return new CatalogEntry(name, cleanedProperties);
}