Difference between “ And ‘ in Spark Dataframe API
You must tell your compiler that you want to represent a string inside a string using a different symbol for the inner string.
Here is an example.
“ Name = “HARI” “
The above is wrong. Why? Because the inner string “HARI” and the outer string are using the same “ symbol. And the compiler gets confused that where the string starts and where it is ending.
The below is correct. Why? Because the compiler knows the outer string starts with a “ and it ends with a “. Similarly, it knows the inner string starts with a ‘ and it ends with a ‘. So you have a clear demarkation of both the strings.
“ Name = ‘HARI’ “
The below is also correct. Why? Because the compiler knows the outer string starts with a ‘ and it ends with a ‘. Similarly, it knows the inner string starts with a “ and it ends with a “. So you have a clear demarkation of both the strings.
‘ Name = “HARI” ‘