简体   繁体   English

针对Spark的eclipse中的Scala插件问题

[英]Scala plugin problem in eclipse for Spark

在此输入图像描述 I am using eclipse ide for Scala and I have downloaded scala-ide plugin from eclipse marketplace. 我正在为Scala使用eclipse ide,我从eclipse市场下载了scala-ide插件。 I am getting error while using scala plugin in eclipse. 我在eclipse中使用scala插件时遇到错误。 Following error message showing while using dot(.) or auto-generating functions in eclipse: 在eclipse中使用点(。)或自动生成函数时显示以下错误消息:

An internal error occurred during: "Computing additional info". 在“计算其他信息”期间发生内部错误。 org.eclipse.jdt.internal.core.SearchableEnvironment.(Lorg/eclipse/jdt/internal/core/JavaProject;Lorg/eclipse/jdt/core/WorkingCopyOwner;) org.eclipse.jdt.internal.core.SearchableEnvironment(Lorg /蚀/ JDT /内部/核心/ JavaProject; Lorg /蚀/ JDT /型芯/ WorkingCopyOwner)。

    import org.apache.spark.SparkContext
    import org.apache.spark.SparkConf
    import org.apache.spark.sql.SparkSession
    import java.lang.Long

    object UrbanPopulation {
        def main(args: Array[String]) {
            val spark = SparkSession
                .builder
                .appName("UrbanPopulation")
                .getOrCreate()
            val data = spark.read.csv(args(0)).rdd
            val result = data.map { line => {
            val uPopulation = line.getString(10).replaceAll(",", "")
                var uPopNum = 0L
                    if (uPopulation.length() > 0)
                    uPopNum = Long.parseLong(uPopulation)
                    (uPopNum, line.getString(0))
            }}.sortByKey(false).first

   spark.sparkContext.parallelize(Seq(result)).saveAsTextFile(args(1))
   spark.stop
        }
    }

[![enter image description here][1]][1]


      [1]: https://i.stack.imgur.com/aTGbp.png

This looks like Eclipse bug 546156 which says that code completion for Scala is broken in Eclipse 2019-03 due to an incompatible change in Eclipe JDT. 这看起来像Eclipse bug 546156 ,它表示由于Eclipe JDT的不兼容变化,Eclipse 2019-03中Scala的代码完成被破坏。

The bug is marked as fixed in the first Milestone release of Eclipse 2019-06 (2019-06M1) planned for availability on 19 April 2019. 该错误在Eclipse 2019-06(2019-06M1)的第一个Milestone版本中标记为已修复,计划于2019年4月19日提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM