[SPARK/Python] 파이썬에서 스파크로 함수 전달하는 방법
·
Data Engineering/Spark
1. 파이썬에서 스파크로 함수 전달하는 예제 (람다식, 실제 함수 전달)#람다식 예제word = rdd.filter(lambda s: "error" in s)#실제 함수를 전달하는 방법def containError(s): return "error" in s word=rdd.filter(containsError) 2.필드 참조가 포함된 함수 전달지양해야 하는 코드class SearchFuntions(object): def __init__(self, query): self.query = query def isMatch(self, s): return self.query in s def getMatchesFuctionsReference(sel..
[Python] inconsistent use of tabs and spaces in indentation 에러
·
Python
inconsistent use of tabs and spaces in indentation 들여쓰기 시, 탭과 스페이스바를 혼용해서 사용했을 때 나타나는 오류이다. 들여쓰기 두 번 해야 하는데 스페이스 네 번, 탭 한 번 눌러서 저 오류가 떴었는데, 탭 두 번으로 고쳤더니 해결되었다.