add pi example for spark and hadoop