Java Code Examples for org.apache.flink.table.typeutils.TypeCheckUtils

The following examples show how to use org.apache.flink.table.typeutils.TypeCheckUtils. These examples are extracted from open source projects. 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
/**
 * Validate the types that are used for conversion to string.
 */
private void validateKeyTypes(int[] keyFieldIndices) {
	final TypeInformation<?>[] types = getFieldTypes();
	for (int keyFieldIndex : keyFieldIndices) {
		final TypeInformation<?> type = types[keyFieldIndex];
		if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
			throw new ValidationException(
				"Only simple types that can be safely converted into a string representation " +
					"can be used as keys. But was: " + type);
		}
	}
}
 
Example 2
Source Project: flink   Source File: ElasticsearchUpsertTableSinkBase.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Validate the types that are used for conversion to string.
 */
private void validateKeyTypes(int[] keyFieldIndices) {
	final TypeInformation<?>[] types = getFieldTypes();
	for (int keyFieldIndex : keyFieldIndices) {
		final TypeInformation<?> type = types[keyFieldIndex];
		if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
			throw new ValidationException(
				"Only simple types that can be safely converted into a string representation " +
					"can be used as keys. But was: " + type);
		}
	}
}
 
Example 3
Source Project: alchemy   Source File: Elasticsearch6TableSink.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Validate the types that are used for conversion to string.
 */
private void validateKeyTypes(int[] keyFieldIndices) {
    final TypeInformation<?>[] types = getFieldTypes();
    for (int keyFieldIndex : keyFieldIndices) {
        final TypeInformation<?> type = types[keyFieldIndex];
        if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
            throw new ValidationException(
                    "Only simple types that can be safely converted into a string representation " +
                            "can be used as keys. But was: " + type);
        }
    }
}
 
Example 4
Source Project: flink   Source File: ElasticsearchUpsertTableSinkBase.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Validate the types that are used for conversion to string.
 */
private void validateKeyTypes(int[] keyFieldIndices) {
	final TypeInformation<?>[] types = getFieldTypes();
	for (int keyFieldIndex : keyFieldIndices) {
		final TypeInformation<?> type = types[keyFieldIndex];
		if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
			throw new ValidationException(
				"Only simple types that can be safely converted into a string representation " +
					"can be used as keys. But was: " + type);
		}
	}
}