Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ private[parquet] object RowReadSupport {
private[parquet] class RowWriteSupport extends WriteSupport[Row] with Logging {

private[parquet] var writer: RecordConsumer = null
private[parquet] var attributes: Seq[Attribute] = null
private[parquet] var attributes: Array[Attribute] = null

override def init(configuration: Configuration): WriteSupport.WriteContext = {
val origAttributesStr: String = configuration.get(RowWriteSupport.SPARK_ROW_SCHEMA)
val metadata = new JHashMap[String, String]()
metadata.put(RowReadSupport.SPARK_METADATA_KEY, origAttributesStr)

if (attributes == null) {
attributes = ParquetTypesConverter.convertFromString(origAttributesStr)
attributes = ParquetTypesConverter.convertFromString(origAttributesStr).toArray
}

log.debug(s"write support initialized for requested schema $attributes")
Expand Down