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

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.

主站蜘蛛池模板: 都江堰市| 东安县| 许昌市| 犍为县| 西宁市| 霸州市| 霍林郭勒市| 金阳县| 遂昌县| 孝昌县| 辰溪县| 武清区| 玛沁县| 民权县| 莱州市| 绥棱县| 东台市| 虎林市| 板桥市| 衡东县| 白沙| 山东省| 建水县| 永平县| 永城市| 广西| 兴安县| 岳普湖县| 浏阳市| 玛纳斯县| 吉林省| 定安县| 葵青区| 鄂托克旗| 南京市| 丰县| 贞丰县| 阿克陶县| 曲阜市| 万宁市| 崇左市|