색조를 사용하여 10GB CSV 파일을 사용하여 하이브 테이블을 만들었습니다. 그런 다음 SQL 쿼리를 실행하려고했습니다. 데이터를 처리하는 동안 2 시간 이상 긴 시간 동안 말하고 있습니다. 아무도 이것이 스파크 문제인지 여부를 말해 줄 수 있습니까 ?? 또는 나는 틀린 무엇인가했다.
나는 실행자, 코어 및 executor 메모리의 수를 변경하는 것과 같은 가능한 모든 조합을 시도했다.왜 spark에서 hiveContex를 사용하는 quantile 계산이 매우 느린가요?
--driver-memory 10g\ --num-executors 10\ --executor-memory 10g\ --executor-cores 10\
나는 num-executor를 10, 15,20,50,100으로 변경하고 메모리 및 코어를 변경하여 테스트했습니다.
클러스터에 대해 말하자면 6 노드 380+ 코어와 1TB 메모리가 있습니다.
My SQL query: select percentile_approx(x1, array(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)) as x1_quantiles, percentile_approx(x2, array(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)) as x2_quantiles, percentile_approx(x3, array(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)) as x3_quantiles from mytest.test1
코드는 스파크 문제가되지 않습니다,
val query= args(0)
val sparkConf= new SparkConf().setAppName("Spark Hive")
val sc = new SparkContext(sparkConf)
val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
sqlContext.cacheTable(" mytest.test1")
val start = System.currentTimeMillis()
val testload=sqlContext.sql(query)
testload.show()
val end = System.currentTimeMillis()
println("Time took " + (end-start) + " ms")
이 문제는 해결 방법을 찾는 데 도움이되었습니다. 고마워요 @ zero323 –