Skip to content

Commit 35eaeb0

Browse files
committed
doc
1 parent 6d26c17 commit 35eaeb0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ object SummaryBuilderImpl extends Logging {
393393
* Reads a buffer from a serialized form, using the row object as an assistant.
394394
*/
395395
def read(bytes: Array[Byte]): Buffer = {
396+
// TODO move this row outside to the aggregate
396397
assert(numFields == 12, numFields)
397398
val row3 = new UnsafeRow(numFields)
398399
row3.pointTo(bytes.clone(), bytes.length)

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Projection.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ case class InterpretedMutableProjection(expressions: Seq[Expression]) extends Mu
101101

102102
/**
103103
* A projection that returns UnsafeRow.
104+
*
105+
* CAUTION: the returned projection object should *not* be assumed to be thread-safe.
104106
*/
105107
abstract class UnsafeProjection extends Projection {
106108
override def apply(row: InternalRow): UnsafeRow
@@ -110,11 +112,15 @@ object UnsafeProjection {
110112

111113
/**
112114
* Returns an UnsafeProjection for given StructType.
115+
*
116+
* CAUTION: the returned projection object is *not* thread-safe.
113117
*/
114118
def create(schema: StructType): UnsafeProjection = create(schema.fields.map(_.dataType))
115119

116120
/**
117121
* Returns an UnsafeProjection for given Array of DataTypes.
122+
*
123+
* CAUTION: the returned projection object is *not* thread-safe.
118124
*/
119125
def create(fields: Array[DataType]): UnsafeProjection = {
120126
create(fields.zipWithIndex.map(x => BoundReference(x._2, x._1, true)))

0 commit comments

Comments
 (0)