@Shambhu Rai - Thanks for the question and using MS Q&A platform.
The error message suggests that the isnull
function is being called with two parameters instead of one. The isnull
function in Spark SQL is used to check if a column is null or not. It takes only one parameter, which is the column to be checked.
In your case, it seems like you are passing two parameters to the isnull
function. The second parameter ''
is not required. If you want to replace null values with an empty string, you can use the coalesce
function instead.
Here's an example of how you can use the coalesce
function to replace null values with an empty string:
SELECT coalesce(col1, '') as col1_new FROM table_name
This will replace any null values in col1
with an empty string and return a new column col1_new
.
For more details, refer to the below links
https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/functions/isnull
https://azurelib.com/how-to-find-null-and-not-null-values-in-pyspark-azure-databricks/
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.