You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by krishmah <kr...@gmail.com> on 2017/05/30 17:01:24 UTC

No TypeTag Available for String

I am currently using Spark 2.0.1 with Scala 2.11.8. However same code works
with Scala 2.10.6. Please advise if I am missing something

import org.apache.spark.sql.functions.udf

val getFileName = udf{z:String => z.takeRight(z.length
-z.lastIndexOf("/")-1)}

and this gives me following error messages

No Type Tag Available for String and

not enough arguments for method udf: (implicit evidence$2:
reflect.runtime.universe.TypeTag[String], implicit evidence$3:
reflect.runtime.universe.TypeTag[String])org.apache.spark.sql.expressions.UserDefinedFunction.
Unspecified value parameters evidence$2, evidence$3.	



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/No-TypeTag-Available-for-String-tp28720.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Re: No TypeTag Available for String

Posted by Ryan <ry...@gmail.com>.
did you include the proper scala-reflect dependency?

On Wed, May 31, 2017 at 1:01 AM, krishmah <kr...@gmail.com> wrote:

> I am currently using Spark 2.0.1 with Scala 2.11.8. However same code works
> with Scala 2.10.6. Please advise if I am missing something
>
> import org.apache.spark.sql.functions.udf
>
> val getFileName = udf{z:String => z.takeRight(z.length
> -z.lastIndexOf("/")-1)}
>
> and this gives me following error messages
>
> No Type Tag Available for String and
>
> not enough arguments for method udf: (implicit evidence$2:
> reflect.runtime.universe.TypeTag[String], implicit evidence$3:
> reflect.runtime.universe.TypeTag[String])org.apache.spark.sql.expressions.
> UserDefinedFunction.
> Unspecified value parameters evidence$2, evidence$3.
>
>
>
> --
> View this message in context: http://apache-spark-user-list.
> 1001560.n3.nabble.com/No-TypeTag-Available-for-String-tp28720.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
>
>