Skip to content

Commit

Permalink
Merge pull request #46 from ruixinxu/update-sample-with-display
Browse files Browse the repository at this point in the history
update python 09
  • Loading branch information
ruixinxu authored Aug 27, 2020
2 parents b7036f9 + bfbe595 commit 923726e
Showing 1 changed file with 57 additions and 30 deletions.
87 changes: 57 additions & 30 deletions Notebooks/PySpark/09 Creating a managed Spark Table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 3,
"execution_count": 4,
"data": {
"text/plain": "DataFrame[]"
},
Expand All @@ -50,11 +50,11 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 4,
"execution_count": 5,
"data": {
"text/plain": "DataFrame[]"
},
Expand All @@ -78,41 +78,68 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 5,
"execution_count": 6,
"data": {
"application/json": {
"rows": [
[
"Bangalore",
10540000
],
[
"Beijing",
21540000
],
[
"San Francisco",
881549
"table": {
"rows": [
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "Seattle",
"population": 730400
}
],
[
"Seattle",
730400
]
],
"schema": [
"name",
"population"
]
"schema": {
"name": "string",
"population": "int"
}
},
"isSummary": false,
"language": "scala"
}
},
"metadata": {}
}
],
"metadata": {},
"metadata": {
"diagram": {
"activateDiagramType": 1,
"chartConfig": {
"category": "bar",
"keys": [
"name"
],
"values": [
"population"
],
"yLabel": "population",
"xLabel": "name",
"aggregation": "SUM",
"aggByBackend": false
},
"aggData": "{\"population\":{\"Bangalore\":10540000,\"Beijing\":21540000,\"San Francisco\":881549,\"Seattle\":730400}}",
"isSummary": false,
"previewData": {
"filter": null
},
"isSql": false
}
},
"source": [
"display(spark.sql(\"SELECT * FROM cities ORDER BY name\"))"
],
Expand All @@ -129,11 +156,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 6,
"execution_count": 7,
"data": {
"text/plain": "DataFrame[]"
},
Expand Down

0 comments on commit 923726e

Please sign in to comment.