spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Sampson <>
Subject RE: When to expect UTF8String?
Date Fri, 12 Jun 2015 19:15:52 GMT
We are using Expression for two things.

1. Custom aggregators that do map-side combine.

2. UDFs with more than 22 arguments which is not supported by ScalaUdf, and to avoid wrapping
a Java function interface in one of 22 different Scala function interfaces depending on the
number of parameters.

Are there methods we can use to convert to/from the internal representation in these cases?
From: Michael Armbrust []
Sent: Thursday, June 11, 2015 9:05 PM
To: Zack Sampson
Subject: Re: When to expect UTF8String?

Through the DataFrame API, users should never see UTF8String.

Expression (and any class in the catalyst package) is considered internal and so uses the
internal representation of various types.  Which type we use here is not stable across releases.

Is there a reason you aren't defining a UDF instead?

On Thu, Jun 11, 2015 at 8:08 PM, zsampson <<>>
I'm hoping for some clarity about when to expect String vs UTF8String when
using the Java DataFrames API.

In upgrading to Spark 1.4, I'm dealing with a lot of errors where what was
once a String is now a UTF8String. The comments in the file and the related
commit message indicate that maybe it should be internal to SparkSQL's

However, when I add a column containing a custom subclass of Expression, the
row passed to the eval method contains instances of UTF8String. Ditto for
AggregateFunction.update. Is this expected? If so, when should I generally
know to deal with UTF8String objects?

View this message in context:<>
Sent from the Apache Spark Developers List mailing list archive at

To unsubscribe, e-mail:<>
For additional commands, e-mail:<>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message