여러 필드가 포함 된 데이터 프레임을 읽고 JSON 데이터를 두 열을 기준으로 다시 분할하고 Pandas로 변환하는 JSON 데이터가 있습니다.Pyspark 간단한 재 파티션 및 toPandas()가 600,000 개 이상의 행에서 완료되지 않습니다.
이 작업은 약간의 오류가있는 단지 600,000 행의 데이터에서 EMR을 사용하지 못합니다. 나는 또한 스파크 드라이버의 메모리 설정을 늘렸고 여전히 해상도를 보지 못했다.
conf = SparkConf().setAppName('myapp1')
conf.set('spark.yarn.executor.memoryOverhead', 8192)
conf.set('spark.executor.memory', 8192)
conf.set('spark.driver.memory', 8192)
sc = SparkContext(conf=conf)
내가 얻을 오류는 다음과 같습니다 :
16/10/01 19:57:56 ERROR executor.CoarseGrainedExecutorBackend: Driver 172.31.58.76:37973 disassociated! Shutting down.
16/10/01 19:57:11 ERROR executor.CoarseGrainedExecutorBackend: Driver 172.31.58.76:42167 disassociated! Shutting down.
16/10/01 19:57:56 ERROR executor.CoarseGrainedExecutorBackend: Driver 172.31.58.76:37973 disassociated! Shutting down.
log4j:ERROR Could not read configuration file from URL [file:/etc/spark/conf/log4j.properties].
log4j:ERROR Ignoring configuration file [file:/etc/spark/conf/log4j.properties].
16/10/01 19:57:11 ERROR ApplicationMaster: RECEIVED SIGNAL 15: SIGTERM
16/10/01 19:57:11 ERROR ApplicationMaster: User application exited with status 143
log4j:ERROR Could not read configuration file from URL [file:/etc/spark/conf/log4j.properties].
log4j:ERROR Ignoring configuration file [file:/etc/spark/conf/log4j.properties].
16/10/01 19:57:56 ERROR ApplicationMaster: RECEIVED SIGNAL 15: SIGTERM
16/10/01 19:57:56 ERROR ApplicationMaster: User application exited with status 143
16/10/01 19:57:11 ERROR executor.CoarseGrainedExecutorBackend: Driver 172.31.58.76:42167 disassociated! Shutting down.
16/10/01 19:57:56 ERROR executor.CoarseGrainedExecutorBackend: Driver 172.31.58.76:37973 disassociated! Shutting down.
를 코드는 잘 최대 작동 다음과 같이
enhDataDf = (
sqlContext
.read.json(sys.argv[1])
)
enhDataDf = (
enhDataDf
.repartition('column1', 'column2')
.toPandas()
)
enhDataDf = sqlContext.createDataFrame(enhDataDf)
enhDataDf = (
enhDataDf
.toJSON()
.saveAsTextFile(sys.argv[2])
)
내 스파크 설정
은 다음과 같습니다 여기 내 pyspark 코드 ~ 600,000 개의 JSON 라인을 지원합니다. 그런 다음 계속 실패합니다.무슨 일이 일어나고 있는지 그리고이 문제를 디버그/수정하는 방법에 대한 의견이 있으십니까?
이것은 여전히 도움이되지 않습니다. 동일한 오류 메시지로 계속 오류를 가져 오십시오. 나는 말 그대로 M4.2xlarge 인스턴스에서 32GB 메모리와 설정을 실행하고 있습니다. 매우 신나는 오류를 제공하고 장님을 피할 수 없게 만드는 것은 매우 성가시다. – Gopala
흠 나는 심지어 당신에게서 upvote @ Gopala를 보지 않는다, 그래서 그것은 나의 대답이 나쁘다는 것을 의미한다, 나는 그것을 삭제해야한다? – gsamaras
나는 대답이 나쁘지 않다고 생각한다. 통찰력과 유용한 링크가 있습니다. 단지 그것이 내 문제를 해결하지 못했고 나는 더 이상의 도움이 있는지를 기다리고있다. – Gopala