class DataTypeUtils {

	public static List<String> flattenToNames(DataType dataType, List<String> existingNames) {
		final LogicalType type = dataType.getLogicalType();
		if (hasRoot(type, LogicalTypeRoot.DISTINCT_TYPE)) {
			return flattenToNames(dataType.getChildren().get(0), existingNames);
		} else if (isCompositeType(type)) {
			return getFieldNames(type);
		} else {
			return Collections.singletonList(getAtomicName(existingNames));
		}
	}

	private  DataTypeUtils();

}