spark idea의 설정 문제
1535 단어 spark
Error:scalac: missing or invalid dependency detected while loading class file 'RDD.class'. Could not access term hadoop in package org.apache, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) A full rebuild may help if 'RDD.class' was compiled against an incompatible version of org.apache.
저 i 밑에 이 버전은 뭐라고 써야 돼요?1.6.1이라고 써야지, 못 찾았어.
아래의 코드를 한 번 뛰어보고 싶은데, 사활에 문제가 있다. 아이고, 나는 자바라는 물건을 매우 싫어한다. 환경 설정은 반나절 동안 말하지 않아도 느려 죽을 지경이다.
/**
* Created by Administrator on 2016/3/31.
*/
import org.apache.spark.{SparkConf, SparkContext}
/**
* Created by Administrator on 2016/3/31.
*/
import scala.math.random
import org.apache.spark._
object simpleApp {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("Spark Pi").setMaster("local")
val spark = new SparkContext(conf)
val slices = if (args.length > 0) args(0).toInt else 2
val n = math.min(100000L * slices, Int.MaxValue).toInt // avoid overflow
val count = spark.parallelize(1 until n, slices).map { i =>
val x = random * 2 - 1
val y = random * 2 - 1
if (x*x + y*y < 1) 1 else 0
}.reduce(_ + _)
println("Pi is roughly " + 4.0 * count / n)
spark.stop()
}
}
다음은 ibm 빅데이터 기반의 교육 자료를 공유합니다.
http://download.csdn.net/detail/wangyaninglm/9478412
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Spark 프로그래밍 기본 사항(Python 버전)참조 웹사이트: Hadoop 환경이 있어야 합니다. 내 다른 블로그를 읽을 수 있습니다. 2.Spark 환경 변수 파일 수정 spark env SH 파일(vi ./conf/spark-env.sh)을 편집하고 첫 번째...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.