1. Overview
DataFrame is a distributed data set, which can be understood as a table in a relational database, organized by fields and field types and field values in columns, and supports four languages, which can be understood in Scala API as: FataFrame=Dataset[ROW]
Note:
DataFrame was generated after V1.3, SchemaRDD before V1.3, and Dataset was added after V1.6
<span style="font-size: 18px;">
Both are distributed containers. DF understands that a table has Schema in addition to RDD data, and also supports complex data types (map..)
<br>
API:
</span>
<span style="font-size: 18px;">
DataFrame provides a richer API than RDD. Support map filter flatMap...
<br>
Data structure: RDD knows that the type has no structure, DF provides Schema information, which is conducive to optimization and good performance
<br>
Bottom layer: Based on the different operating environment, the Java/Scala API developed by RDD runs the underlying environment JVM,
<br>
</span>
<span style="font-size: 18px;">
DF is converted into a logical execution plan (locaical plan) and a physical execution plan (Physical Plan) in SparkSQL. It has a self-optimization function, and the performance difference is large.
<br>
</span>
<span style="font-size: 18px;">
root
<br>
|-- age: long (nullable = true) - field type is allowed to be empty
<br>
|-- name: string (nullable = true)
<br>
</span>
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.