Skip to content

Commit 923726e

Browse files
authored
Merge pull request #46 from ruixinxu/update-sample-with-display
update python 09
2 parents b7036f9 + bfbe595 commit 923726e

File tree

1 file changed

+57
-30
lines changed

1 file changed

+57
-30
lines changed

Notebooks/PySpark/09 Creating a managed Spark Table.ipynb

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 3,
24+
"execution_count": 4,
2525
"outputs": [
2626
{
2727
"output_type": "execute_result",
28-
"execution_count": 3,
28+
"execution_count": 4,
2929
"data": {
3030
"text/plain": "DataFrame[]"
3131
},
@@ -50,11 +50,11 @@
5050
},
5151
{
5252
"cell_type": "code",
53-
"execution_count": 4,
53+
"execution_count": 5,
5454
"outputs": [
5555
{
5656
"output_type": "execute_result",
57-
"execution_count": 4,
57+
"execution_count": 5,
5858
"data": {
5959
"text/plain": "DataFrame[]"
6060
},
@@ -78,41 +78,68 @@
7878
},
7979
{
8080
"cell_type": "code",
81-
"execution_count": 5,
81+
"execution_count": 6,
8282
"outputs": [
8383
{
8484
"output_type": "execute_result",
85-
"execution_count": 5,
85+
"execution_count": 6,
8686
"data": {
8787
"application/json": {
88-
"rows": [
89-
[
90-
"Bangalore",
91-
10540000
92-
],
93-
[
94-
"Beijing",
95-
21540000
96-
],
97-
[
98-
"San Francisco",
99-
881549
88+
"table": {
89+
"rows": [
90+
{
91+
"name": "Bangalore",
92+
"population": 10540000
93+
},
94+
{
95+
"name": "Beijing",
96+
"population": 21540000
97+
},
98+
{
99+
"name": "San Francisco",
100+
"population": 881549
101+
},
102+
{
103+
"name": "Seattle",
104+
"population": 730400
105+
}
100106
],
101-
[
102-
"Seattle",
103-
730400
104-
]
105-
],
106-
"schema": [
107-
"name",
108-
"population"
109-
]
107+
"schema": {
108+
"name": "string",
109+
"population": "int"
110+
}
111+
},
112+
"isSummary": false,
113+
"language": "scala"
110114
}
111115
},
112116
"metadata": {}
113117
}
114118
],
115-
"metadata": {},
119+
"metadata": {
120+
"diagram": {
121+
"activateDiagramType": 1,
122+
"chartConfig": {
123+
"category": "bar",
124+
"keys": [
125+
"name"
126+
],
127+
"values": [
128+
"population"
129+
],
130+
"yLabel": "population",
131+
"xLabel": "name",
132+
"aggregation": "SUM",
133+
"aggByBackend": false
134+
},
135+
"aggData": "{\"population\":{\"Bangalore\":10540000,\"Beijing\":21540000,\"San Francisco\":881549,\"Seattle\":730400}}",
136+
"isSummary": false,
137+
"previewData": {
138+
"filter": null
139+
},
140+
"isSql": false
141+
}
142+
},
116143
"source": [
117144
"display(spark.sql(\"SELECT * FROM cities ORDER BY name\"))"
118145
],
@@ -129,11 +156,11 @@
129156
},
130157
{
131158
"cell_type": "code",
132-
"execution_count": 6,
159+
"execution_count": 7,
133160
"outputs": [
134161
{
135162
"output_type": "execute_result",
136-
"execution_count": 6,
163+
"execution_count": 7,
137164
"data": {
138165
"text/plain": "DataFrame[]"
139166
},

0 commit comments

Comments
 (0)