【发布时间】:2020-03-22 21:14:52
【问题描述】:
我正在使用 Spark 2.3。我想从给定的类型参数创建一个 DataType 对象:例如 StringType、IntegerType...
我试过这个:
String type="StringType" or String type="IntegerType";
DataType dataType=DataType.fromJson(type);
我遇到了这个异常
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'StringType': was expecting ('true', 'false' or 'null')
at [Source: StringType; line: 1, column: 21]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
谁能指导我解决这个问题。
谢谢
【问题讨论】:
标签: java apache-spark hadoop hdfs bigdata