Errata

Snowflake: The Definitive Guide

Errata for Snowflake: The Definitive Guide

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page Page 38
4th paragraph

Current statement reads as "The following SQL script will create a medium-sized virtual warehouse, with four clusters ...". The word "clusters" should be changed to "servers".

Michael Winterbottom  Jan 25, 2023 
PDF Page Page 49
Caption for Figure 2-20

Currently reads as "The virtual warehouse cache in the Snowflake cloud services layer".

Should read as "The virtual warehouse cache in the Snowflake compute layer".

Michael Winterbottom  Jan 30, 2023 
PDF Page Page 78
Last code example on page

Currently reads as ...
"DELETE FROM <Base_Table> WHERE <Column_Name> >
(SELECT AVG <Column> FROM <View_Name>);"

Should read as ...
"DELETE FROM <Base_Table> WHERE <Column_Name> >
(SELECT AVG <Column_Name> FROM <View_Name>);"

Michael Winterbottom  Jan 30, 2023 
PDF Page Page 82
Last paragraph

Currently reads as ...
"You can create stored functions in JavaScript and UDFs in SQL"

The word "functions" here should be changed to "procedures".

Michael Winterbottom  Jan 31, 2023 
PDF Page Page 85
1st code example on page

Currently reads as ...

CREATE OR REPLACE FUNCTION FACTORIAL(n variant)
RETURNS variant LANGUAGE JAVASCRIPT AS
'var f=n;
for (i=n-1; i>0; i--) {
f=f*i}
return f';

Snowflake "Troubleshooting JavaScript UDFs" documentation states that "JavaScript is case sensitive, but SQL forces names to upper case. This can affect UDF input parameter names, for example. JavaScript code should reference input parameter names by using all upper case."

Accordingly, in order to get the above code example to work I had to reference the input parameter as upper case (i.e., as "N" instead of "n") inside the function specification. I also was not able to get it to run with the input variable set to a type of variant ... but I could get it to run if I changed the type of the input parameter to DOUBLE. Following is the version that I was able to get to run correctly ...

use role SYSADMIN; use database DEMO3C_DB;
create or replace function MYFACTORIAL(n DOUBLE) returns DOUBLE language JAVASCRIPT as
'var f=N;
for (i=N-1; i>0; i--) { f=f*i }
return f';

Michael Winterbottom  Jan 31, 2023 
PDF Page Page 85
1st code example on page

The function created by the code example is called FACTORIAL ... however this appears to conflict with Snowflake's built-in factorial function. For example, upon momentarily mangling this FACTORIAL function and selecting FACTORIAL(5), the correct results of 120 were still returned. To get my newly specified function to accurately reflect my current function definition, I had to use a unique function name such as MYFACTORIAL.

Michael Winterbottom  Jan 31, 2023 
PDF Page Page 85
Mid-page

Currently reads as ...
"Try finding the result of FACTORIAL(50) and see what happens. If you use the number 50 in the factorial function, you’ll receive an error message telling you that the numeric value is out of range (as shown in Figure 3-26)."

I was able to replicate this error when using Snowflake's built-in FACTORIAL function. However, when I changed the name of the function I was defining to something unique (so that it did not conflict with the built-in factorial function), such as MYFACTORIAL, then no such error was encountered when I entered large numbers into the function (e.g., select MYFACTORIAL(50)).

Michael Winterbottom  Jan 31, 2023 
PDF Page Page 95
Code example near middle of page

Code example currently reads as ...

ALTER TASK IF EXISTS tsk_15 SUSPEND;

However the task name is 'tsk_wait_15' ... and therefore the above should be:

ALTER TASK IF EXISTS tsk_wait_15 SUSPEND;

Michael Winterbottom  Feb 01, 2023 
PDF Page Snowflake Streams (Deep Dive) - page 96
Opening paragraph of this section

A suggestion/recommendation ...

It would be highly beneficial to include something similar to the following to the opening explanatory paragraph about streams (as it wasn't evident that stream entries go away once they're consumed by a non-SELECT DML statement):

A stream advances its offset only when it is referenced within an executed DML transaction other than a SELECT (i.e., an INSERT, DELETE, or UPDATE statement). Accordingly, specific records present within the stream that are consumed by a given INSERT, DELETE, or UPDATE statement, will no longer be present in the stream subsequent to the execution of that statement.

Michael Charles Winterbottom  Feb 02, 2023 
PDF Page Page 120
2nd code example on the page

Currently reads as ...

SELECT ID, AMT
FROM DEMO4_DB.SUBQUERIES.DERIVED
WHERE AMT = (SELECT AMT
FROM DEMO4_DB.SUBQUERIES.TABLE2
WHERE ID = ID);

As per the description of this example, the where clause within the subquery is intended to compare the ID field of the table referenced in the subquery (TABLE2), to the ID field of the table referenced in the external query (DERIVED). When I add tables aliases to the example to reinforce this intent, as in ...

SELECT ID, AMT
FROM DEMO4_DB.SUBQUERIES.DERIVED AS D
WHERE AMT = (SELECT AMT
FROM DEMO4_DB.SUBQUERIES.TABLE2 AS T
WHERE T.ID = D.ID);

... execution of this more explicit version of the example yields TWO rows, instead of just one, as is suggested by the current description:

ID AMT
1 1000
3 3000

Michael Winterbottom  Feb 02, 2023 
PDF Page Page 170
2nd paragraph

Currently reads as ...
"We also can attempt to assign to a user a default role that does exist:"

Should read as (insert the word "not") ...
"We also can attempt to assign to a user a default role that does not exist:"

Michael Winterbottom  Feb 14, 2023 
PDF Page Page 332
Figure 10-17

Label in the blue box currently reads as ...
Data provide account

Should read as ...
Data provider account

Michael Winterbottom  Mar 02, 2023 
Mobi Page Chapter 2, section “Creating and Using Virtual Warehouses”
3rd paragraph

I was reading the Kindle sample of this book and on Chapter 2, section “Creating and Using Virtual Warehouses”, 3rd paragraph it says “script will create a medium-sized virtual warehouse, with four clusters […]”.
Is this correct?
Thank you Joyce.
Regards,
Vítor

Vítor Fonseca  Mar 22, 2023 
Other Digital Version Tommy Ireland 0411667501
5

MY ERRORS :.Number from 0411667501
SITES :hackathon.microsoft.chrome app
And my account device & home wifi??

Anonymous  Apr 16, 2023 
Other Digital Version Chapter 4, near figure 4-5
Correlated Subquery

the author is giving an example for correlated subqueries; unfortunately, the query gets interpreted by Snowflake as an uncorrelated subquery. This happens because the column ID that is used to generate the correlation has the same name in both tables, and is used without a qualifier; the condition as written is ID = ID. As a result, Snowflake resolves it as if the condition is TABLE2.ID = TABLE2.ID. The condition must be written as DERIVED.ID = TABLE2.ID for Snowflake to correctly understand the intention.

p.s. currently, the query returns 1 row (which is what baffled me). If you correct the condition, you'd see that it will return 2 rows. 

Morteza Saharkhiz  Apr 22, 2023 
O'Reilly learning platform Page Chapter - 2: Billing for the Cloud Services Layer
Most cloud services consumption is already incorporated into Snowflake pricing. However, when customers occasionally exceed 10% of their daily compute credit usage, they are billed for the overage.

Most cloud services consumption is already incorporated into Snowflake pricing. However, when customers occasionally exceed 10% of their daily compute credit usage, they are billed for the overage.

Typo: Instead of average it was mispelled.

Raghav  Feb 26, 2024 
PDF Page 308
middle of page

Currently reads as ...
Equality searches use equality predicates such as <column name> = <constant
value> whereas range searches query ranges in time.

The reference to "in time" at the end of the statement, appears to be overly specific (i.e., what about ranges in values not associated with time?). Perhaps alter to read as ...
Equality searches use equality predicates such as <column name> = <constant
value> whereas range searches query ranges of values.

Michael Winterbottom  Feb 27, 2023 
PDF Page 350
last paragraph

Currently reads as ...

Next, hover your cursor over the STORE_SALES table, or look in the dedicated section at the bottom, and you’ll see a preview that shows there are more than 288 billion rows in the table.

The "dedicated section at the bottom" referenced here, does not appear until the user actually clicks on the table name ... i.e., it's not sufficient to simply hover over the table name to see this information.

Michael Winterbottom  Feb 24, 2023