Skip to content

Commit

Permalink
move input parameters to the same line as map function
Browse files Browse the repository at this point in the history
  • Loading branch information
seancxmao committed Aug 20, 2018
1 parent ce4c935 commit 9261beb
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,15 @@ private[parquet] object ParquetReadSupport {
structType.map { f =>
caseInsensitiveParquetFieldMap
.get(f.name.toLowerCase)
.map {
parquetTypes =>
if (parquetTypes.size > 1) {
// Need to fail if there is ambiguity, i.e. more than one field is matched
val parquetTypesString = parquetTypes.map(_.getName).mkString("[", ", ", "]")
throw new AnalysisException(s"""Found duplicate field(s) "${f.name}": """ +
s"$parquetTypesString in case-insensitive mode")
} else {
clipParquetType(parquetTypes.head, f.dataType, caseSensitive)
}
.map { parquetTypes =>
if (parquetTypes.size > 1) {
// Need to fail if there is ambiguity, i.e. more than one field is matched
val parquetTypesString = parquetTypes.map(_.getName).mkString("[", ", ", "]")
throw new AnalysisException(s"""Found duplicate field(s) "${f.name}": """ +
s"$parquetTypesString in case-insensitive mode")
} else {
clipParquetType(parquetTypes.head, f.dataType, caseSensitive)
}
}.getOrElse(toParquet.convertField(f))
}
}
Expand Down

0 comments on commit 9261beb

Please sign in to comment.