Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos in chapter 2 section 1.4 #11

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
"source": [
"### Decimals and Why did my Decimals overflow\n",
"\n",
"Some cases where you would deal with `Decimal` types are if you are talking about money, height, weight, etc. Working with `Decimal` types may appear at first but there are some nuances that will sneak up behind you. We will go through some ways to avoid these nauances as they are hard to debug.\n",
"Some cases where you would deal with `Decimal` types are if you are talking about money, height, weight, etc. Working with `Decimal` types may appear simple at first but there are some nuances that will sneak up behind you. We will go through some ways to get around these as they are hard to debug.\n",
"\n",
"Here are some simple jargon that we will use in the follow examples:\n",
"* `Integer`: The set of numbers including all the whole numbers and their opposites (the positive whole numbers, the negative whole numbers, and zero). ie. -1,0,1,2, etc.\n",
"Here is some simple jargon that we will use in the following examples:\n",
"* `Integer`: The set of numbers including all the whole numbers and their opposites (the positive whole numbers, the negative whole numbers, and zero). ie. -1, 0, 1, 2, etc.\n",
"* `Irrational Number`: The set including all numbers that are non- terminating, non- repeating decimals. ie. 2.1, 10.5, etc.\n",
"* `Precision`: the maximum total number of digits.\n",
"* `Scale`: the number of digits on the right of dot.\n",
Expand Down Expand Up @@ -120,7 +120,7 @@
"source": [
"**What Happened?**\n",
"\n",
"Let's breakdown the examples above.\n",
"Let's break down the examples above.\n",
"\n",
"Example 1:\n",
"\n",
Expand Down Expand Up @@ -190,7 +190,7 @@
"source": [
"**What Happened?**\n",
"\n",
"What happened to our `scalar` values, they weren't read in? This is because the default arguments to the `T.Decimal()` function are `DecimalType(precision=10, scale=0)`. So in order read in the data correctly we need to override these default arguments."
"What happened to our `scalar` values, they weren't read in? This is because the default arguments to the `T.Decimal()` function are `DecimalType(precision=10, scale=0)`. So to read in the data correctly we need to override these default arguments."
]
},
{
Expand Down Expand Up @@ -280,9 +280,9 @@
"source": [
"**What Happened?**\n",
"\n",
"Why is the second value null? The second value overflows the max value of and never makes it to Spark (Scala). \n",
"Why is the second value null? The second value overflows the max value of a decimal and never makes it to Spark (Scala). \n",
"\n",
"If a similar error happens then you will need to check your input data as there might be something wrong there."
"If you see this error then you will need to check your input data as there might be something wrong there."
]
},
{
Expand Down Expand Up @@ -326,7 +326,7 @@
"source": [
"**What Happened?**\n",
"\n",
"Remember our python examples above? Well because the `precision` of the Spark `T.DecimalType` is 38 digits, the value went over the precious of the Spark type."
"Remember our python examples above? Well because the `precision` of the Spark `T.DecimalType` is 38 digits, the value went over the maximum value of the Spark type."
]
},
{
Expand Down Expand Up @@ -491,7 +491,7 @@
"source": [
"**What Happened?**\n",
"\n",
"Before doing the calculations, we truncated (with the help of the `cast` function, which we will learn about in the later chapters) all of the values to be only 2 `scalar` digits at most. This should be the way you should be performing your arithmetic operations with `Decimal Types`. Ideally you should know the minimal number of `scalar` digits needed for each datatype."
"Before doing the calculations, we truncated (with the help of the `cast` function, which we will learn about in the later chapters) all of the values to be only 2 `scalar` digits at most. This is how you should perform your arithmetic operations with `Decimal Types`. Ideally you should know the minimum number of `scalar` digits needed for each datatype."
]
},
{
Expand All @@ -500,9 +500,9 @@
"source": [
"### Summary\n",
"\n",
"* We learnt that you should always initial `Decimal` types using string represented numbers, if they are Irrational Number.\n",
"* We learned that you should always initial `Decimal` types using string represented numbers, if they are an Irrational Number.\n",
"* When reading in `Decimal` types, you should explicitly override the default arguments of the Spark type and make sure that the underlying data is correct.\n",
"* When performing arthimetrics operations with decimal types you should always truncate the scalar digits to the lowest number of digits as possible, if you haven't already."
"* When performing arithmetic operations with decimal types you should always truncate the scalar digits to the lowest number of digits as possible, if you haven't already."
]
}
],
Expand Down