2016-09-07 3 views
1

ローカルマシンのバージョン2.0でscalaを実行しています。エラー:見つからない:value StructType/StructField/StringType

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._がインポートされましたが、まだこのエラーが発生しています。私はパッケージを紛失していますか?

+2

試みをインポートし、それが働い –

+0

感謝をしてみてください:) – toofrellik

答えて

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

は...これらのクラスがどこにあるようだ、 `org.apache.spark.sql.types._`をインポート

関連する問題