Skip to content

Commit

Permalink
update checkInputColumn to print more info if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rekhajoshm committed Jul 3, 2015
1 parent 33ddd2e commit 8c42b57
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ object SchemaUtils {
* @param colName column name
* @param dataType required column data type
*/
def checkColumnType(schema: StructType,
colName: String,
dataType: DataType,
msg: String = ""): Unit = {
def checkColumnType(
schema: StructType,
colName: String,
dataType: DataType,
msg: String = ""): Unit = {
val actualDataType = schema(colName).dataType
val message = if (msg != null && msg.trim.length > 0) " " + msg else ""
require(actualDataType.equals(dataType),
Expand Down

0 comments on commit 8c42b57

Please sign in to comment.