scala: solve etl