Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2025 06:44 PM
hi , i am loading dataframe data into spark sql table using .saveastable() option.. scema is matching..but column names are diffirent in sql table. is it necessary to maintain the same column names in source and target ? how to handle it in real time, either modifying column names in dataframe or using insert into option in sql..
sales_df_cleaned.createOrReplaceTempView("sales")
spark.sql("select count(*) from sales").show()
insert into dev.spark_db.tbl_instax_sales
select * from sales
or
modifying column names in dataframe and load in table ..
sales_df_cleaned.write.mode("overwrite").saveAsTable("dev.spark_db.tbl_instax_sales")