This course focuses onSpark, the hottest, most popular and promising technology in the big Data world today. In this course, from shallow to deep, based on a large number of case studies, in-depth analysis and explanation of Spark, and will contain completely from the enterprise real complex business needs to extract the actual case. The course will cover Scala programming,
none, and below we look at the use of option:
Next, take a look at filter processing:
Here's a look at the zip operation for the collection:
Here's a look at the partition of the collection:
We can use flatten's multi-collection for flattening operations:
Flatmap is a combination of map and flatten operations, first map operation and then flatten operation:
"Spark Asia-Pacific Research ser
3, hands-on generics in Scalageneric generic classes and generic methods, that is, when we instantiate a class or invoke a method, you can specify its type, because Scala generics and Java generics are consistent and are not mentioned here. 4, hands on. Implicit conversions, implicit parameters, implicit classes in Scalaimplicit conversion is one of the key points that many people learn about Scala, which i
3, hands on the abstract class in ScalaThe definition of an abstract class requires the use of the abstract keyword:
The above code defines and implements the abstract method, it is important to note that we put the direct running code in the trait subclass of the app, about the inside of the app helps us implement the Main method and manages the code written by the engineer;Here's a look at the use of uninitialized variables in an abstract class:
4, hands-on trait in ScalaTrait
1. PreparationThis article focuses on how to build the Spark 2.11 stand-alone development environment in Ubuntu 16.04, which is divided into 3 parts: JDK installation, Scala installation, and spark installation.
JDK 1.8:jdk-8u171-linux-x64.tar.gz
Scala 11.12:scala
Learn Spark 2.0 (new features, real projects, pure Scala language development, CDH5.7)Share the network disk download--https://pan.baidu.com/s/1c2f9zo0 password: pzx9Spark entered the 2.0 era, introducing many excellent features, improved performance, and more user-friendly APIs. In the "unified programming" is very impressive, the implementation of offline computing and Flow computing API unification, the
The spark kernel is developed by the Scala language, so it is natural to develop spark applications using Scala. If you are unfamiliar with the Scala language, you can read Web tutorials A Scala Tutorial for Java programmers or re
Scala Beginner's intermediate-Advanced Classic (66th: Scala concurrent programming experience and its application in Spark source code) content introduction and video link2015-07-24DT Big Data Dream FactoryFrom tomorrow onwards, be a diligent person.Watch videos, videos, share videosDT Big Data Dream Factory-scala--Adv
Directory installation JDK installation Scala IDE for Eclipse configuration spark configuration Hadoop create Maven engineering Scala code entry 7 Item 8 Item 9
Installing the JDK
Requires installation of jdk1.8 or later.Back to Catalog
installing Scala IDE for Eclipse
Package Com.leegh.parameterization/*** @author Guohui Li*/Object Type_contraints {def main (args:array[string]): Unit = {def Rocky[t] (i:t) (implicit ev:t println ("Life is too short,you need spark!")}Rocky ("Spark")}}Report:This blog description:1. Organize your ideas and improve yourself.2. Be educated in Liaoliang teacher, what to gain, so recommend.3. Blog focus on practice, superfluous words are not mu
Package Com.leegh.parameterization/*** @author Guohui Li*/Class Pair[t def bigger = if (First.compareto (second) > 0) First Else second}Class Pair_lower_bound[t] (Val first:t, Val second:t) {def Replacefirst[r;: T] (newfirst:r) = new Pair_lower_bound[r] (Newfirst, second)}Object Type_variables_bounds {def main (args:array[string]): Unit = {Val pair = new pair ("Spark", "Hadoop")println (Pair.bigger)}}Report:This blog description:1. Organize your ideas
Package Com.leegh.parameterization/*** @author Guohui Li*/Because breathe returns This,scala the return type is inferred as animal, and because animal has no eat methodClass Animal {def breathe = this}Class Cat extends Animal {def eat = this}Class Animal {def Breathe:this.type = this}Class Cat extends Animal {def eat:this.type = this}Object Singleton_types {def main (args:array[string]): Unit = {Val cat = new CatCat.breathe.eat}}Report:This blog descr
public number is Dt_spark, every day will have big data actual combat video release, please continue to study.Liaoliang DT Big Data dream factory Scala all videos, PPT and code in Baidu Cloud disk link:http://pan.baidu.com/share/home?uk=4013289088#category/type=0 Qq-pf-to=pcqq.groupLiaoliang "Scala Beginner's introductory classic video course" http://edu.51cto.com/lesson/id-66538.htmlLiaoliang "
Package Com.leegh.parameterization/*** @author Guohui Li*/Class PersonClass Student extends PersonClass C[+t] (Val args:t)Trait Friend[-t] {def makefriend (Somebody:t)}Object Variance {def makefriendwithyou (S:student, f:friend[student]) {f.makefriend (s)}def main (args:array[string]): Unit = {Val Value:c[person] = new C[student] (new Student)}}Report:This blog description:1. Organize your ideas and improve yourself.2. Be educated in Liaoliang teacher, what to gain, so recommend.3. Blog focus on
This article first describes how to configure the Maven+scala development environment in Eclipse, and then describes how to implement the spark local run. Finally, the spark program written by Scala is successfully run.
At first, my Eclipse+maven environment was well configured.
System: Win7
Eclipse version: Luna rele
The Java version of the spark Big Data Chinese word Segmentation Statistics program was completed, and after a week of effort, the Scala version of the sparkBig Data Chinese Word segmentation Statistics program also made out, here to share to you want to learn spark friends.The following is the final interface of the program, and the Java version is not very diff
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.