环境支持
1、The default build is now using Scala 2.11 rather than Scala 2.10
解释:编译Spark版本的环境从Scala 2.10变成了2.11。标志着以后写Scala程序,也最好使用
2、【Deprecation】Support for Java 7,Support for Python 2.6
解释:不建议使用的版本,java7和Python2.6。另外,Spark对Python3的支持已经不错了,如果使用PySpark,建议直接使用Python3,要少些麻烦。
3、Spark 2.0 no longer requires a fat assembly jar for production deployment.
解释:部署到生产环境中,不再需要那个臃肿的assembly文件了(貌似是对Scala开发的福利)。
4、2.x默认的日志级别为WARN
可以自己设置级别
方式一:
sc.setLogLevel("INFO")` -> Spark 1.6中的级别
方式二:
配置{SPARK_HOME}/conf/log4j.properties
log4j.logger.org.apache.spark.repl.Main=INFO
Spark-Core
1、Unifying DataFrame and Dataset: In Scala and Java, DataFrame and Dataset have been unified, i.e. DataFrame is just a type alias for Dataset of Row. In Python and R, given the lack of type safety, DataFrame is the main programming interface.
解释:在Scala语言与Java语言中,统一了DataFrame与Dataset数据结构。Python和R中,因为语言本身缺少类型安全机制,因此DataFrame还是主要的编程接口。
2、SparkSession: new entry point that replaces the old SQLContext and HiveContext for DataFrame and Dataset APIs. SQLContext and HiveContext are kept for backward compatibility.
解释:SparkSession成为了新的入口,统一了旧的SQLContext与HiveContext。但为了向后兼容,这两个依然可用。
3、Native CSV data source, based on Databricks’ spark-csv module
解释:官方支持了CSV作为数据源(更方便了,不用再像以前一个split来手动解析)
Spark-SQL
1、A native SQL parser that supports both ANSI-SQL as well as Hive QL
解释:新的SQL解析引擎,同时支持Ansi-sql(sql-2003标准,也是ansi的最新版本)与Hive QL。
2、Substantial (2 - 10X) performance speedups for common operators in SQL and DataFrames via a new technique called whole stage code generation
解释:经过验证,通过一个新的被称为”全段代码生成”的技术,对常用的SQL操作和DataFrame,性能有2-10倍的提升。
3、Improved ORC performance
解释:提升了ORC存储格式的性能,这也正是HDP2大力支持的数据格式。
4、Uncorrelated Scalar Subqueries,Correlated Scalar Subqueries
解释:相关或者不相关的标量子查询(可以直接在select中的标量处直接写子查询)。
5、/in/not in/EXISTS/not exists predicate subqueries (in WHERE/HAVING clauses)
解释:在Where与having条件中,可以写断言式子查询,支持in/not in/exists/not exists。
Spark-Streaming
1、支持结构化流,按照批次分成RDD去处理,将流的数据放到表中,表中的数据不断提升(智能化的流式处理)
Spark-ML
1、The DataFrame-based API is now the primary API. The RDD-based API is entering maintenance mode.
解释:机器学习,基于DataFrame的API变成了主要的API,基于RDD的API进入维护模式。
2、ML persistence: The DataFrames-based API provides near-complete support for saving and loading ML models and Pipelines in Scala, Java, Python, and R
解释:ML库模型的持久化:基于DataFrame的api提供几乎完整的保存与加载模型,和Pipelines的支持。
3、Python: PySpark now offers many more MLlib algorithms, including LDA, Gaussian Mixture Model, Generalized Linear Regression, and more.
解释:Pyspark提供了更多的算法,如LDA(主题模型),高斯混合和广义线性回归。