1

I want to use the when() method in org.apache.spark.sql.Column, when I go ahead, it turns out to be like this. enter image description here

I have tried things like IntelliJ inspection gives "Cannot resolve symbol" but still compiles code but it just doesn't work, what should I do now?

Steve YN
  • 69
  • 1
  • 7

1 Answers1

1

when() is inside the org.apache.spark.sql.functions

So you need to import the functions as

import org.apache.spark.sql.functions._

or

import org.apache.spark.sql.functions.when
koiralo
  • 22,594
  • 6
  • 51
  • 72