Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14363#discussion_r72735867
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -721,16 +723,16 @@ private[hive] class HiveClientImpl(
         Utils.classForName(name)
           .asInstanceOf[Class[_ <: 
org.apache.hadoop.hive.ql.io.HiveOutputFormat[_, _]]]
     
    -  private def toHiveColumn(c: CatalogColumn): FieldSchema = {
    -    new FieldSchema(c.name, c.dataType, c.comment.orNull)
    +  private def toHiveColumn(c: StructField): FieldSchema = {
    +    new FieldSchema(c.name, c.dataType.catalogString, 
c.getComment().orNull)
       }
     
    -  private def fromHiveColumn(hc: FieldSchema): CatalogColumn = {
    -    new CatalogColumn(
    +  private def fromHiveColumn(hc: FieldSchema): StructField = {
    +    val f = StructField(
           name = hc.getName,
    -      dataType = hc.getType,
    -      nullable = true,
    -      comment = Option(hc.getComment))
    +      dataType = CatalystSqlParser.parseDataType(hc.getType),
    --- End diff --
    
    So the behaviour change is: previously if a hive table contains type string 
that we can't parse, we are still able to describe it, but throw an exception 
if we try to read it. After this PR, we will throw an exception when we try to 
read its table meta from hive meta store.
    
    I think it's ok to break it, but need better error message. what do you 
think? cc @yhuai @liancheng 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to