Skip to content

Commit

Permalink
Merge pull request #48 from ruixinxu/update-sample-with-display
Browse files Browse the repository at this point in the history
fix the display issue and run error in sample notebook
  • Loading branch information
ruixinxu authored Sep 1, 2020
2 parents ab3b486 + 5415018 commit f53365a
Show file tree
Hide file tree
Showing 8 changed files with 891 additions and 239 deletions.
103 changes: 73 additions & 30 deletions Notebooks/PySpark/08 Creating an unmanaged Spark Table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 9,
"execution_count": 4,
"data": {
"text/plain": "DataFrame[]"
},
Expand All @@ -48,11 +48,11 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 10,
"execution_count": 5,
"data": {
"text/plain": "DataFrame[]"
},
Expand All @@ -76,41 +76,84 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 6,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 11,
"execution_count": 6,
"data": {
"application/json": {
"rows": [
[
"Bangalore",
10540000
"table": {
"rows": [
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "Seattle",
"population": 730400
},
{
"name": "Seattle",
"population": 730400
}
],
[
"Beijing",
21540000
],
[
"San Francisco",
881549
],
[
"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\":21080000,\"Beijing\":43080000,\"San Francisco\":1763098,\"Seattle\":1460800}}",
"isSummary": false,
"previewData": {
"filter": null
},
"isSql": false
}
},
"source": [
"display(spark.sql(\"SELECT * FROM cities ORDER BY name\"))"
],
Expand All @@ -127,11 +170,11 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 7,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 12,
"execution_count": 7,
"data": {
"text/plain": "DataFrame[]"
},
Expand Down
125 changes: 92 additions & 33 deletions Notebooks/Scala/08 Creating an unmanaged Spark Table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 17,
"execution_count": 4,
"data": {
"text/plain": "res6: org.apache.spark.sql.DataFrame = []"
"text/plain": "res0: org.apache.spark.sql.DataFrame = []"
},
"metadata": {}
}
Expand All @@ -48,13 +48,13 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 18,
"execution_count": 5,
"data": {
"text/plain": "res7: org.apache.spark.sql.DataFrame = []"
"text/plain": "res1: org.apache.spark.sql.DataFrame = []"
},
"metadata": {}
}
Expand All @@ -76,41 +76,100 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 6,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 19,
"execution_count": 6,
"data": {
"application/json": {
"rows": [
[
"Bangalore",
10540000
"table": {
"rows": [
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Bangalore",
"population": 10540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "Beijing",
"population": 21540000
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "San Francisco",
"population": 881549
},
{
"name": "Seattle",
"population": 730400
},
{
"name": "Seattle",
"population": 730400
},
{
"name": "Seattle",
"population": 730400
}
],
[
"Beijing",
21540000
],
[
"San Francisco",
881549
],
[
"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\":31620000,\"Beijing\":64620000,\"San Francisco\":2644647,\"Seattle\":2191200}}",
"isSummary": false,
"previewData": {
"filter": null
},
"isSql": false
}
},
"source": [
"display(spark.sql(\"SELECT * FROM cities ORDER BY name\"))"
],
Expand All @@ -127,13 +186,13 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 7,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 20,
"execution_count": 7,
"data": {
"text/plain": "res9: org.apache.spark.sql.DataFrame = []"
"text/plain": "res5: org.apache.spark.sql.DataFrame = []"
},
"metadata": {}
}
Expand Down
Loading

0 comments on commit f53365a

Please sign in to comment.