您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
本篇内容介绍了“SparkSql读取hive表tblproperties异常如何解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
集群环境
sparksql读取Parquet 格式的hive表报错
hive的parquet表,hive和impala读取正常,使用spark-sql读取则报错
异常信息
com.fasterxml.jackson.core.JsonParseException: Unexpected end-of-input within/between Object entriesat [Source: (String)"{"type":"struct","fields":[{"name":"timestamp","type":"string","nullable":true,"metadata":{"HIVE_TYPE_STRING":"string"}},{"name":"xxx","type":"string","nullable":true,"metadata":{"HIVE_TYPE_STRING":"string"}},{"name":"xxx","type":"string","nullable":true,"; line: 1, column: 513]at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipAfterComma2(ReaderBasedJsonParser.java:2323)at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipComma(ReaderBasedJsonParser.java:2293)at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:664)at org.json4s.jackson.JValueDeserializer.deserialize(JValueDeserializer.scala:47)at org.json4s.jackson.JValueDeserializer.deserialize(JValueDeserializer.scala:39)at org.json4s.jackson.JValueDeserializer.deserialize(JValueDeserializer.scala:32)at org.json4s.jackson.JValueDeserializer.deserialize(JValueDeserializer.scala:46)at org.json4s.jackson.JValueDeserializer.deserialize(JValueDeserializer.scala:39)at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1611)at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1219)at org.json4s.jackson.JsonMethods$class.parse(JsonMethods.scala:25)at org.json4s.jackson.JsonMethods$.parse(JsonMethods.scala:55)at org.apache.spark.sql.types.DataType$.fromJson(DataType.scala:127)at org.apache.spark.sql.hive.HiveExternalCatalog$.org$apache$spark$sql$hive$HiveExternalCatalog$$getSchemaFromTableProperties(HiveExternalCatalog.scala:1382)at org.apache.spark.sql.hive.HiveExternalCatalog.restoreDataSourceTable(HiveExternalCatalog.scala:845)at org.apache.spark.sql.hive.HiveExternalCatalog.org$apache$spark$sql$hive$HiveExternalCatalog$$restoreTableMetadata(HiveExternalCatalog.scala:765)at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$getTable$1.apply(HiveExternalCatalog.scala:734)at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$getTable$1.apply(HiveExternalCatalog.scala:734)
tblproperites不全的问题,应该是hive存储tblproperites的表,参数字段存在截断,因此找到metastore库中的TABLE_PARAMS表,检查PARAM_VALUE字段,发现该字段的长度仅为256,找到问题
将PARAM_VALUE的长度修改为8000,问题解决
“SparkSql读取hive表tblproperties异常如何解决”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。