在导入flink-release-1.4.2的pom之后,我尝试运行wordcount示例。但是由于Scala出现许多错误,所以我无法构建它。
Information:19-2-20 上午2:45 - Compilation completed with 53 errors and 0 warnings in 2s 439ms
/media/maple/新加卷/download/Notes/flink-release-1.4.2/flink-examples/flink-examples-batch/src/main/scala/org/apache/flink/examples/scala/clustering/KMeans.scala
Error:(81, 14) not found: type ExecutionEnvironment
val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
Error:(81, 37) not found: value ExecutionEnvironment
val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
Error:(85, 17) not found: type DataSet
val points: DataSet[Point] = getPointDataSet(params, env)
Error:(131, 74) not found: type DataSet
def getPointDataSet(params: ParameterTool, env: ExecutionEnvironment): DataSet[Point] = {
Error:(131, 51) not found: type ExecutionEnvironment
def getPointDataSet(params: ParameterTool, env: ExecutionEnvironment): DataSet[Point] = {
Error:(86, 20) not found: type DataSet
val centroids: DataSet[Centroid] = getCentroidDataSet(params, env)
那是怎么回事。当我仅导入flink-examples的pom时,wordcount程序可以正常运行。例如:
我尝试重新导入Maven,使缓存无效并安装Scala插件。
答案 0 :(得分:0)
使用IntelliJ,您将需要JetBrains Scala插件,并且需要打开项目结构对话框,并在“全局库”部分中添加Scala SDK。
答案 1 :(得分:0)
问题已解决。我运行library(ggplot2)
dat <- iris[c(1,2,51,52,101,102),]
dat[1,"Species"] <- NA
dat[["Species"]] <- factor(dat[["Species"]],
levels = c("virginica", NA, "setosa", "versicolor"),
exclude = NULL)
dat[["Species"]]
# [1] <NA> setosa versicolor versicolor virginica virginica
# Levels: virginica <NA> setosa versicolor
# NA is the second level
ggplot(dat, aes(x=Species, y=Sepal.Width)) + geom_point()
# NA appears at right
并成功重建。