put some logic into spark-scripts