def getOrderedDFBasedOnTableStructure(inputDF:DataFrame, tableName :String,spark:SparkSession): Unit ={ val columnNames = spark.table(tableName).columns logInfo(s"table $tableName is having columns in this $columnNames") val orderedDF = inputDF.select(columnNames.head, columnNames.tail: _*) orderedDF}
No comments:
Post a Comment