frameless icon indicating copy to clipboard operation
frameless copied to clipboard

Missing implemention errors

Open pgrandjean opened this issue 4 years ago • 1 comments

I am trying to use frameless in Databricks. Thanks to advice on gitter, I made some code modifications as described in dsabanin/frameless@1ce8f0b, based on frameless 0.8.0. However, running some tests related to my application, I am getting "an implementation is missing" errors.

The error is raised when reaching the following code in dataset/src/main/scala/frameless/functions/Lit.scala:

protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = ???

The functional code triggering the error:

val opt: Option[String] = Some("bar")
val tds = TypedDataset.createUnsafe(...)
val filtered = opt.map(v => tds.filter(tds('foo) === v)).getOrElse(tds) // here

pgrandjean avatar Apr 16 '21 01:04 pgrandjean

not sure if this is correct, but this seems to fix the problem:

  protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    ctx.references += this

    val resultEval = encoder.toCatalyst(new Literal(obj, encoder.jvmRepr)).genCode(ctx)
    
    ev.copy(
      code = resultEval.code,
      value = resultEval.value,
      isNull = resultEval.isNull
    )
  }

pgrandjean avatar Apr 16 '21 21:04 pgrandjean

would be fixed by #700

chris-twiner avatar Apr 11 '23 11:04 chris-twiner

@pomadchin - this should also be closeable now due to #699

chris-twiner avatar Jun 02 '23 14:06 chris-twiner

Oh yes, this is closed via #699, 💯

pomadchin avatar Jun 02 '23 14:06 pomadchin