본문 바로가기

전체239

SPARK 의 헷갈림 reduce(), fold() 아래와 같은 현상이 이상했다. >>> reduce(lambda x, y: (x*2) + y, [1,2,3,4])26>>> sc.parallelize([1,2,3,4]).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],1).reduce(lambda x, y: (x*2) + y)26>>> sc.parallelize([1,2,3,4],2).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],3).reduce(lambda x, y: (x*2) + y)18>>> sc.parallelize([1,2,3,4],4).reduce(lambda x, y: (x*2) + y)26 뭐지? partition 을.. 2017. 2. 16.
SPARK reduce() 개념도 출처 : http://backtobazics.com/big-data/spark/apache-spark-reduce-example/ 2017. 2. 16.
SPARK aggregate() 함수 설명 및 진행 과정 책에서 봤을 때 내부 과정이 이해가 안 되었음. 그래서 찾아봤더니 이런 심오한 .... 일단 이 함수를 이해하는데 기억해야 할 점은 2가지... 1) rdd 데이터 타입과 action 결과 타입이 다를 경우 사용한다. 2) 뻔한 얘기지만, spark 는 분산처리 프레임웍이다. 각 파티션이 분산되어있어, 연산을 할 때는 파티션 단위의 연산과 각 연산된 결과를 합치는 과정을 거치게 된다. So let us now have that look at the signature: Page on apache.org def aggregate[U](zeroValue: U)(seqOp: (U, T) ⇒ U, combOp: (U, U) ⇒ U)(implicit arg0: ClassTag[U]): U 위와 같다. - seqOp.. 2017. 2. 16.
lambda - lambda calculus 에서 유래했다함. - 걍 익명함수.- 코드의 가독성이 높아짐. (코드의 흐름이 끊기지 않고 자연스럽게 연결됨)- 개인적으로 왜 lambda 함수는 multiline or multi statement 는 지원이 안되는지 궁금함 .. * multiline 관련 .. 파이썬 만든 사람 답변"But the complexity of any proposed solution for this puzzle is immense, to me: it requires the parser (or more precisely, the lexer) to be able to switch back and forth between indent-sensitive and indent-insensitive mod.. 2017. 2. 15.