I have 45 pyspark scripts to run where a password is stored in each script. I want to use a file placed in HDFS where I can store the password and use this for all the scripts.
Instead of changing password, I will do in file (please refer to the script below).
from pyspark.context import SparkContext
from pyspark.sql import HiveContext
from pyspark.sql.functions import *
from pyspark.sql.types import *
sc = SparkContext()
sqlContext = HiveContext(sc)
sqlContext.setConf("spark.sql.tungsten.enabled", "false")
CSKU_query = """ (select * from CSKU) a """
CSKU = sqlContext.read.format("jdbc").options(url="jdbc:sap://myip:port",currentschema="SAPABAP1",user="username",password="mypassword",dbtable=CSKU_query).load()
CSKU.write.format("parquet").save("/user/admin/sqoop/base/sap/CSKU/")
Instead of specifying password in each script, it should fetch from file where i can refer that.
Thanks in advance