Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- token=lib.auth(tenant_id='ddb8592f-ed74-4329-bfd2-571b7c34699e',client_secret='6J+HpWdO1ZzKZBDxxgpQHLr75QQaG2Kvv/da7jRzyg8=',client_id='0f081437-f824-4f10-944d-92f0db6bc37b')
- adls_client=core.AzureDLFileSystem(token,store_name='adlsedhdev')
- strFormat='Test Results_Source And Raw CDM JSON validation_%Y-%m-%d_%H-%M-%S'
- strFileName= datetime.now().strftime(strFormat)
- #creating a new html file for every run
- strResultFilePath='/mnt/adlsedhdev/DEV/Result'+ strFileName + '.html'
- with adls_client.open(strResultFilePath,'wb') as f:
- #"strhtmlbody" is a string variable which has HTML code
- f.write(str.encode(strhtmlbody))
- f.flush()
- f.close()
- #"strhtmlbody" is a string variable which has HTML code
- rdd = spark.sparkContext.parallelize([strhtmlbody])
- rdd.repartition(1).coalesce(1).overwrite().saveAsTextFile('/mnt/adlsedhdev/DEV/Result')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement