class MergeTableLikeUtil {

	public List<String> mergePartitions(
			MergingStrategy mergingStrategy,
			List<String> sourcePartitions,
			List<String> derivedPartitions) {

		if (!derivedPartitions.isEmpty() &&
				!sourcePartitions.isEmpty() &&
				mergingStrategy != MergingStrategy.EXCLUDING) {
			throw new ValidationException("The base table already has partitions defined. You might want to specify " +
				"EXCLUDING PARTITIONS.");
		}

		if (!derivedPartitions.isEmpty()) {
			return derivedPartitions;
		}
		return sourcePartitions;
	}

	  MergeTableLikeUtil(
			SqlValidator validator,
			Function<SqlNode, String> escapeExpression);

}