Advertisement
Guest User

Untitled

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