SPARK-2452, create a new valid for each  instead of using lineId.