Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Jul 8, 2015
1 parent 0cc1b37 commit a099d3e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ private[parquet] class CatalystRowConverter(

override def end(): Unit = updater.set(currentArray)

// NOTE: We can't reuse the mutable Map here and must instantiate a new `ArrayBuffer` for the
// next value. `Row.copy()` only copies row cells, it doesn't do deep copy to objects stored
// in row cells.
override def start(): Unit = currentArray = ArrayBuffer.empty[Any]

// scalastyle:off
Expand All @@ -334,8 +337,8 @@ private[parquet] class CatalystRowConverter(
* @see https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#backward-compatibility-rules
*/
// scalastyle:on
private def isElementType(repeatedType: Type, elementType: DataType): Boolean = {
(repeatedType, elementType) match {
private def isElementType(parquetRepeatedType: Type, catalystElementType: DataType): Boolean = {
(parquetRepeatedType, catalystElementType) match {
case (t: PrimitiveType, _) => true
case (t: GroupType, _) if t.getFieldCount > 1 => true
case (t: GroupType, StructType(Array(f))) if f.name == t.getFieldName(0) => true
Expand Down Expand Up @@ -383,6 +386,9 @@ private[parquet] class CatalystRowConverter(

override def end(): Unit = updater.set(currentMap)

// NOTE: We can't reuse the mutable Map here and must instantiate a new `Map` for the next
// value. `Row.copy()` only copies row cells, it doesn't do deep copy to objects stored in row
// cells.
override def start(): Unit = currentMap = mutable.Map.empty[Any, Any]

/** Parquet converter for key-value pairs within the map. */
Expand Down

0 comments on commit a099d3e

Please sign in to comment.