I have the below schema, val schema = new StructType( Array( StructField("Age",IntegerType,true), StructField("Name",StringType,true), ) )
I want to keep it in a separate file in the same format and use it in my Spark program. I have seen that I can create a json format schema in a file for the same and use it in my program. But is there a way to use the same structtype format in a file and then read it?
Just to note, my schema file can contain multiple schemas like
val schema1=...
val schema2=...
val schema3=...