StructField(fi-6ren">
gpt4 book ai didi

scala - 错误:找不到:值StructType/StructField/StringType

转载 作者:行者123 更新时间:2023-12-01 06:43:17 25 4
gpt4 key购买 nike

我在本地计算机2.0版上运行scala。

val schema = StructType(schemaString.split("|^").map(fieldName =>StructField(fieldName, StringType, true)))
<console>:45: error: not found: value StructType
val schema = StructType(schemaString.split("|^").map(fieldName =>StructField(fieldName, StringType, true)))
^
<console>:45: error: not found: value StructField
val schema = StructType(schemaString.split("|^").map(fieldName => StructField(fieldName, StringType, true)))
^
<console>:45: error: not found: value StringType
val schema = StructType(schemaString.split("|^").map(fieldName => StructField(fieldName, StringType, true)))
^

我加载了导入org.apache.spark.sql._,但仍然收到此错误。我缺少任何包裹吗?

最佳答案

import org.apache.spark.sql.types.{StructType, StructField, StringType, IntegerType};

尝试导入

关于scala - 错误:找不到:值StructType/StructField/StringType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39364840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com