diff options
author | Reynold Xin <rxin@databricks.com> | 2015-05-27 11:54:35 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-05-27 11:54:35 -0700 |
commit | 6fec1a9409b34d8ce58ea1c330b52cc7ef3e7e7e (patch) | |
tree | c49721a726d4ab1aa019bb1cf8d8ec4616c0cdb7 /sql/catalyst | |
parent | 0db76c90ad5f84d7a5640c41de74876b906ddc90 (diff) | |
download | spark-6fec1a9409b34d8ce58ea1c330b52cc7ef3e7e7e.tar.gz spark-6fec1a9409b34d8ce58ea1c330b52cc7ef3e7e7e.tar.bz2 spark-6fec1a9409b34d8ce58ea1c330b52cc7ef3e7e7e.zip |
Removed Guava dependency from JavaTypeInference's type signature.
This should also close #6243.
Author: Reynold Xin <rxin@databricks.com>
Closes #6431 from rxin/JavaTypeInference-guava and squashes the following commits:
e58df3c [Reynold Xin] Removed Gauva dependency from JavaTypeInference's type signature.
Diffstat (limited to 'sql/catalyst')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala index 625c8d3a62..9a3f9694e4 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala @@ -39,11 +39,20 @@ private [sql] object JavaTypeInference { private val valuesReturnType = classOf[JMap[_, _]].getMethod("values").getGenericReturnType /** + * Infers the corresponding SQL data type of a JavaClean class. + * @param beanClass Java type + * @return (SQL data type, nullable) + */ + def inferDataType(beanClass: Class[_]): (DataType, Boolean) = { + inferDataType(TypeToken.of(beanClass)) + } + + /** * Infers the corresponding SQL data type of a Java type. * @param typeToken Java type * @return (SQL data type, nullable) */ - private [sql] def inferDataType(typeToken: TypeToken[_]): (DataType, Boolean) = { + private def inferDataType(typeToken: TypeToken[_]): (DataType, Boolean) = { // TODO: All of this could probably be moved to Catalyst as it is mostly not Spark specific. typeToken.getRawType match { case c: Class[_] if c.isAnnotationPresent(classOf[SQLUserDefinedType]) => |