Skip to content

Commit 6edf7f8

Browse files
committed
Re-add convertToScala(), since a Hive test still needs it
1 parent 3f7b2d8 commit 6edf7f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/CatalystTypeConverters.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ object CatalystTypeConverters {
353353
case other => other
354354
}
355355

356+
/**
357+
* Converts Catalyst types used internally in rows to standard Scala types
358+
* This method is slow, and for batch conversion you should be using converter
359+
* produced by createToScalaConverter.
360+
*/
361+
def convertToScala(catalystValue: Any, dataType: DataType): Any = {
362+
getConverterForType(dataType).toScala(catalystValue)
363+
}
364+
356365
/**
357366
* Creates a converter function that will convert Catalyst types to Scala type.
358367
* Typical use case would be converting a collection of rows that have the same schema. You will

0 commit comments

Comments
 (0)