Spark Add Leading Zero to Column in Spark DataFrame | Using Spark Scala

preview_player
Показать описание
#apachespark #pyspark #bigdata
How to Add Leading Zero in Spark | Add Preceding Zero Using Spark Scala

We will learn different ways to Add Leading Zero or Preceding Zero in a column in Spark Dataframe Using Spark Scala. We will have a demo on three methods that Apache Spark offers. Using lpad(),format_string(),concat(),substring().

Blog For Notebook Attachment:

==========================
Same Scenario Using PySpark:

=========================

Blog link to learn more on Spark:

Linkedin profile:

FB page:
Рекомендации по теме
Комментарии
Автор

Hi If you could add the library which you are using for your coadings that would be great for us to use and learn. For example which library need to import for converting RDD to dataframe. Since you are using databricks notebook the library might be inbuilt. When we are tying in IDE we are getting error. If i use this code i am getting error for the line toDF. I am googling it but not getting exact answer.

This is working with below code in IDE

val list_data=Seq(("Babu", 20), ("Raja", 8), ("Mani", 75), ("Kalam", 100), ("Zoin", 7), ("Kal", 53))
val df1=spark.createDataFrame(list_data).toDF("Name", "Marks")
df1.show()

juneyou
Автор

Brother I'm your permanent subscriber and I have seen your all videos i have one dought about rdd
Q.1
How to modify any column like C3=(C2*C1+100) like this in rdd if we have pipelines separated text file can you explain me here either provide me your mail ID

ShyamYadav-pvuc