@Override
	public Map<String, ExecutionContext> partition(int gridSize) {
		StringBuilder incrementalClause = new StringBuilder();
		Map<String, ExecutionContext> result = new HashMap<>();

		if(!StringUtils.hasText(checkColumn) && !StringUtils.hasText(column)) {
			ExecutionContext value = new ExecutionContext();
			value.put("partClause", "");
			result.put("partition0", value);
			value.put("partSuffix", "");
		}
		else {
			if(StringUtils.hasText(checkColumn)) {
				incrementalClause.append(checkColumn).append(" > ").append(this.incrementalMin);
			}

			long targetSize = (this.partitionMax - this.partitionMin) / partitions + 1;

			int number = 0;
			long start = this.partitionMin;
			long end = start + targetSize - 1;

			while (start >= 0 && start <= this.partitionMax) {
				ExecutionContext value = new ExecutionContext();
				result.put("partition" + number, value);

				if (end >= this.partitionMax) {
					end = this.partitionMax;
				}

				if(StringUtils.hasText(checkColumn)) {
					value.putString("partClause", String.format("WHERE (%s BETWEEN %s AND %s) AND %s", column, start, end, incrementalClause.toString()));
				}
				else {
					value.putString("partClause", String.format("WHERE (%s BETWEEN %s AND %s)", column, start, end));
				}

				value.putString("partSuffix", "-p"+number);
				start += targetSize;
				end += targetSize;
				number++;

				log.debug("Current ExecutionContext = " + value);
			}
		}

		return result;
	}
Partition a database table assuming that the data in the column specified
are uniformly distributed. The execution context values will have keys
<code>minValue</code> and <code>maxValue</code> specifying the range of
values to consider in each partition.

@see Partitioner#partition(int)
extensions/spring-xd-extension-batch/src/main/java/org/springframework/batch/integration/x/IncrementalColumnRangePartitioner.java