Home > database >  The Spark SQL Nvl function how to use
The Spark SQL Nvl function how to use

Time:09-26

Wanted to do a sentence empty and then to the query results will be the default value is set to zero, but don't know SparkSql Nvl function how to use, the following statement

The Nvl function will display an error below

Wish you a great god help consult!

CodePudding user response:

Don't know the building Lord not solved, can use coalesce function, coalesce (a, b), if a is null, the value of b will be used to coalesce (col (" name "), lit (" jack ")), if the value of the name column is empty, will be the value of the column set to jack, posted a solution to come out, want to students in need can see https://stackoverflow.com/questions/46318577/spark-dataframe-implement-oracle-nvl-function-while-joining
  • Related