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

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.

主站蜘蛛池模板: 枣庄市| 宣恩县| 环江| 凤山县| 喀喇| 庄河市| 莱州市| 彭阳县| 五台县| 怀仁县| 屏东县| 青河县| 惠水县| 浪卡子县| 中卫市| 浏阳市| 绥中县| 宣化县| 个旧市| 射洪县| 高淳县| 都江堰市| 石家庄市| 彭水| 大庆市| 沅陵县| 呼玛县| 北碚区| 密云县| 全州县| 普兰店市| 汉川市| 马龙县| 龙游县| 黔江区| 延川县| 法库县| 海晏县| 右玉县| 宁晋县| 清苑县|