How to rename a column in a Dataframe in Apache Spark
Hey there! Welcome to ClearUrDoubt.com. In this post, we will look at withColumnRenamed() function in Apache Spark SQL API. withColumnRenamed(String columnName, String newColumnName) is used to rename a column in a Dataframe. Let’s look at the below code snippet in spark-shell for renaming a column: [crayon-67dabf22530d7594094370/] sc.range(1,10).toDF() – creates an RDD with numbers from 1 to 10 … Continue reading How to rename a column in a Dataframe in Apache Spark
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed