官术网_书友最值得收藏!

Summary

This chapter started by explaining the SparkSession object and file I/O methods. It then showed that Spark- and HDFS-based data could be manipulated as both, DataFrames with SQL-like methods and Datasets as strongly typed version of Dataframes, and with Spark SQL by registering temporary tables. It has been shown that schema can be inferred using the DataSource API or explicitly defined using StructType on DataFrames or case classes on Datasets.

Next, user-defined functions were introduced to show that the functionality of Spark SQL could be extended by creating new functions to suit your needs, registering them as UDFs, and then calling them in SQL to process data. This lays the foundation for most of the subsequent chapters as the new DataFrame and Dataset API of Apache Spark is the way to go and RDDs are only used as fallback.

In the coming chapters, we'll discover why these new APIs are much faster than RDDs by taking a look at some internals of Apache SparkSQL in order to understand why Apache SparkSQL provides such dramatic performance improvements over the RDD API. This knowledge is important in order to write efficient SQL queries or data transformations on top of the DataFrame or Dataset relational API. So, it is of utmost importance that we take a look at the Apache Spark optimizer called Catalyst, which actually takes your high-level program and transforms it into efficient calls on top of the RDD API and, in later chapters, Tungsten, which is integral to the study of Apache Spark.

主站蜘蛛池模板: 保山市| 博乐市| 佳木斯市| 武义县| 界首市| 洱源县| 通海县| 新竹市| 扎鲁特旗| 稻城县| 库伦旗| 巴林右旗| 阳谷县| 咸阳市| 运城市| 涞水县| 静海县| 曲松县| 克什克腾旗| 克山县| 明溪县| 通州区| 田林县| 安泽县| 鸡西市| 五大连池市| 四子王旗| 宜川县| 方城县| 南安市| 曲麻莱县| 江孜县| 吉安市| 云龙县| 诸暨市| 太谷县| 利辛县| 怀远县| 延安市| 云梦县| 江门市|