[review] Action operator of RDD

3, RDD action operator The so-called action operator is actually a method that can trigger Job execution 1,reduce  function signature def reduce(f: (T, T) => T): T  function description Aggregate all elements in RDD, first aggregate data in partitions, and then aggregate data between partitions val rdd: RDD[Int] = sc.m ...

Posted by vapour_ on Mon, 03 Jan 2022 10:46:22 +0100

Tuples and OOP examples of [Scala learning]

A FEW MISCELLANEOUS ITEMS https://docs.scala-lang.org/overviews/scala-book/misc.html In this section we'll cover a few miscellaneous items about Scala: Tuples tuplesScala OOP example of pizza restaurant order entry system TUPLES https://docs.scala-lang.org/overviews/scala-book/tuples.html Tuple is a concise class that provid ...

Posted by Genesis730 on Thu, 30 Dec 2021 17:21:37 +0100

Scala pattern matching

Basic grammar The pattern matching in scala is similar to the switch syntax in Java, but Scala adds more functions from the syntax, so it is more powerful. In the pattern matching syntax, the match keyword is used to declare, and each branch is declared with the case keyword. When matching is needed, it will start from the first case branc ...

Posted by phprock on Mon, 27 Dec 2021 06:37:12 +0100

Factory mode of design mode

Factory mode First, let's look at the traditional design pattern Now there is a demand: the production of Xiaomi mobile phones Mobile interface //Mobile interface public interface Phone { void make(); } Xiaomi mobile phone //Xiaomi mobile phone public class MiPhone implements Phone { public MiPhone() { this.make(); } ...

Posted by iBuddy Media on Wed, 22 Dec 2021 12:41:37 +0100

When asked about Map by an interviewer, Map should have eight questions

Preface I have read several foreign blogs about Java map in the last few days and have written very well, so I have sorted out eight issues that Java map should master, which are common problems in daily development. I hope they will help you. If there are any incorrect points, please mention them. Thank you very much. 1. How to convert a Map ...

Posted by mhoward on Tue, 21 Dec 2021 21:15:16 +0100

Special topic on new features of JDK8-03 functional interface

1. Origin of functional interface We know that the premise of using Lambda expression is to have functional interface, and Lambda expression does not care about interface name and abstract method name. Only the parameter list and return value type of the abstract method are concerned. Therefore, in order to make it easier for us to use Lam ...

Posted by sprinkles on Sun, 19 Dec 2021 09:26:03 +0100

spark io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s)

Error log: 1. Error log: ​ WARN TaskSetManager: Lost task 29.0 in stage 22.0 (TID 1851, wn108-cdlcns.bjduloineequ3adfbkrpgi4p2c.shax.internal.chinacloudapp.cn, executor 25): FetchFailed(BlockManagerId(2, wn107-cdlcns.bjduloineequ3adfbkrpgi4p2c.shax.internal.chinacloudapp.cn, 7447, None), shuffleId=12, mapId=4, reduceId=29, message= org.apach ...

Posted by godster on Fri, 17 Dec 2021 02:33:23 +0100

scala ---- list, ancestor, set and related knowledge

1. Array 1.1 general Array is a container used to store multiple elements of the same type. Each element has a number (also known as subscript, subscript and index), and the number starts from 0. In Scala, there are two kinds of arrays, one is a fixed length array and the other is a variable length array 1.2 fixed length array 1.2.1 feature ...

Posted by soupy127 on Mon, 29 Nov 2021 23:32:31 +0100

Spark source code reading 02 - storage analysis of spark storage principle

Overall framework Spark storage adopts master-slave mode, i.e. Master / Slave mode. The whole enclosure uses RPC message communication mode. Of which: The Master is responsible for the management and maintenance of data block metadata during the operation of the whole applicationSlave is responsible for reporting the status information of ...

Posted by machiavelli1079 on Thu, 25 Nov 2021 02:28:07 +0100

Big data -- sorting out common interview questions in Scala

catalogue 1. Advantages of Scala language 2. Closures in Scala 3. Coritization in Scala 4. The relationship and difference between Java and Scala 5. Pattern matching in Scala 6. Difference between case class and class 7. Talk about implicit operation in Scala 8. Partial function and partial application function in Scala 9. Tuples in Sc ...

Posted by cedricm on Fri, 19 Nov 2021 22:13:09 +0100