I have created CSV files through spark dataframe which are getting KMS encrypted automatically.
For your reference, I am giving a sample code snippet that is creating these KMS encrypted files. If you see while writing I am not giving any KMS key. It will be really helpful if you tell the root cause.
val df=spark.read.format("csv").option("header", "true").load("s3:///test/App_IP.csv")
df.createOrReplaceTempView("test")
val df1=spark.sql("select name from test")
df1.coalesce(1).write.format("com.databricks.spark.csv").option("header", "true").save("s3://test/city5/")
This code I am executing from spark-shell in EMR cluster (emr-5.24.0), spark version is Spark 2.4.2