Using Lineage concept to build spark code