하이브의 테이블에서 일부 텍스트 분석을 수행 할 때 pyspark를 사용하고 있습니다. 나는이 수출됩니다 경우가스파크 데이터 프레임을 하이브 데이터베이스로 내보낼 때 Java 힙 공간 오류가 발생했습니다.
INFO FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
Exception in thread "stdout writer for python" 17/02/02 15:18:44 ERROR Utils: Uncaught exception in thread stdout writer for python
java.lang.OutOfMemoryError: Java heap space
난 상관 없어 날이 오류를 제공, 나는 그것을 내보내려고 나는 그러나
words_data.show(2)
을 할 수
from pyspark.sql import SQLContext, Row, HiveContext
from pyspark.sql.functions import col, udf, StringType
from pyspark.sql.types import *
from pyspark import SparkContext
hc = HiveContext(sc)
df=hc.sql("select * from table1")
def cleaning_text(sentence):
sentence=sentence.lower()
sentence=re.sub('\'',' ',sentence)
cleaned=' '.join([w for w in cleaned.split() if not len(w)<=2 ])
return cleaned
org_val=udf(cleaning_text,StringType())
data=df.withColumn("cleaned",org_val(df.text))
data_1=data.select('uniqueid','cleaned','parsed')#2630789 #2022395
tokenizer = Tokenizer(inputCol="cleaned", outputCol="words")
wordsData = tokenizer.transform(data_1)
hc.sql("SET spark.sql.hive.convertMetastoreParquet=false")
hc.sql("create table table2 (uniqueid string, cleaned string, parsed string)")
wordsData.insertInto('table2')
다음 코드를 사용하여 텍스트 파일로도.
'17/02/02 16시 49분 47초은 MemoryManager 경고 내 문제를 해결
을 시작하는 동안 아래 문을 실행하여 변경 : 총 할당은 95.00 %를 초과 (948,830,208 바이트) 29 개의 작성자에 대해 행 그룹 크기를 24.38 %로 조정 17/02/02 16:50:17 오류 Utils : 파이썬의 스레드 stdout 작성자에서 캐치되지 않는 예외 java.lang.OutOfMemoryError : Java 힙 공간 '이것은 생성 된 오류입니다. –