By Developers, For Developers

Historical errata for Seven Databases in Seven Weeks, Second Edition

PDF PgPaper PgTypeDescriptionFixed onComments
viiSUGGEST

Preface

the database isn’t the refinery,
the app is
( who is it who is choosing essences from the pool of data? )
it seems overstepping credibility, is all.

The database is the oil field,
the app is the refinery,
or jointly with the database, the server/app is the refinery,
but no, the database without the application isn’t the refinery.

( basic story regime: if one blows credibility for any reason, immersion is blown up, and that may recover, but…
it isn’t necessary in the first place! )

Namaste!

2018-03-01
5SUGGEST

DynamoDB
only non open source, cloud db.

say more description than /that/, there, Dood!

this section is ssupposed to /introduce/ them, not suggest they are shady…

( :

2018-03-01
7SUGGEST

“In Chapter 6, Neo4J , we discuss the most popular graph database today, Neo4J.”

from the Department of Redundancy Department, is this?

delete one of the Neo4j’s…

( :

( ps: to the maintainer of this web-page…
1. there should be a radio-button to choose which format i am commenting on,
AND .mobi locations should be as acceptable as PDF pages!
i have to have /both/ PDF & .mobi open, so as to be allowed to comment on the .mobi, because this page was designed by someone who didn’t use .mobi?
Humbug!
: )

2018-03-01
14SUGGEST

Canada & UK style postal-codes do not work like zip-codes of the US:
M4C 1B5
in Toronto identifies a specific /building/ or /face of an individual block/
so to use the first 2 chars of the post-code would probably unambiguously identify the city.

However, there are LOTS of apartment buildings & block-faces in Toronto,
each having its own postal-code,
and i think this described database is going to be a bit bugged…

( :

2018-03-01
72ERROR

Context: My work colleagues and I are doing the new 2nd edition of Seven Databases for our book club — there’s seven programmers in total. We just finished talking about the third chapter on HBase, and have some broad feedback.

1. We all had trouble — some more than others — getting HBase running. Installing it with Homebrew is easy, and it would initially work, but intermittently we’d all eventually get a variety of inscrutable Zookeeper errors. I suspect it might’ve been related to changing network conditions (like getting on and off Wi-Fi), but I’m not sure. Pointing out the existence of the hbase-site.xml was useful because one of my colleagues had success deleting network configs out of that file and got it working. I’m not really sure what the answer is here, just thought I’d point it out.

2. We all finished the Day 1 exercises and homework. However, most of us gave up in the middle of the technical exercise on Day 2 — only one person finished Day 2 (Wikipedia) completely, and no one began Day 3 (AWS). It was difficult to complete Day 2 because of various errors.

3. We had trouble running the script for importing from Wikipedia. It was difficult to find the example XML dump we were required to download. And I suspect we all downloaded different files. Perhaps it would be useful to link to a file that does not change and is tied to the specific JRuby script that’s contained in the book. The only person that made it past this section said he manually edited the JRuby script to successfully parse the Wikipedia XML.

4. Someone reported that they had trouble getting the “Admiral Ackbar” command to work, although I forget the specifics of the problem. Something about the command never finishes running?

I’m sorry that this feedback is not more specific and not more constructive. We’re having a good time reading the book, though! The Postgres chapter was a breeze.

2018-03-01
166156ERROR

When I run this line:
zcat < dbdump_artistalbumtrack.xml.gz | ruby import_from_jamendo.rb 10000

I get this error:
import_from_jamendo.rb:92:in `read’: No such file or directory @ rb_sysopen - 10000 (Errno::ENOENT)
\tfrom import_from_jamendo.rb:92:in `parse’
\tfrom import_from_jamendo.rb:92:in `

I’m on macOS 10.13.1 and Ruby 2.4.1. I seem to get this error no matter whether I’m using the new code download from the pragprog.com website, the old code on GitHub from 2012, or the code copied from the book.

2018-03-01
166156ERROR

This is follow-up to my last erratum I submitted earlier today.

This command does not work:
$ zcat < dbdump_artistalbumtrack.xml.gz | ruby import_from_jamendo.rb 10000

So I went back to the first edition of the book, and discovered that this line has changed. If you revert back to how it was originally written, then it works:

$ zcat < dbdump_artistalbumtrack.xml.gz | ruby import_from_jamendo.rb

Essentially, that trailing `1000` is what’s causing the problem. The code does not expect that.

2018-03-01
93TYPO

“which allows you to stored objects”
should read
“which allows you to store objects”

2018-03-01
62TYPO

“When you fetch a row in HBase, you’re not fetch a set of values, you’re fetching a small world.”

It should be “… you’re not fetching a set …”

2018-03-01
292SUGGEST

Context: our book club is reading this book.

Suggestion: We found Day 3 for Redis to be the best, and most exciting part of the entire book — where you combine three databases into a polyglot persistence model. It seems strange to make this part of the Redis section — it almost needs to be its own chapter.

In fact, I’d love to see this one chapter expanded into its own book — a polygot persistence cookbook, perhaps. You seldom get this kind of experience because authors usually focus on only one database in isolation.

We had a lot of fun reading the book. Thank you for working on this 2nd edition.

2018-03-01
234ERROR

In Day 2 of DynamoDB
Section: Getting our Keys Right

ReadingId attribute is mentioned but not used in SensorData table.

185ERROR

The vintages on the figure are all 2007, but they should be 2015, 2010 & 2002

186ERROR

This query returns nothing (because no friends relationships starts from Alice)

MATCH (p:Person {name: “Alice”})—>(other: Person)
RETURN other.name;

Also, there shouldn’t be any space between `other:` and `Person`

185ERROR

On the figure, we should have a double grape_type relationship between the Prancing wolf ice wine and Riesling. One that was specified exactly on ice wine and a second for the general grape_type attribution to all Prancing Wolf.

Same principle for the produced relationship between Prancing Wolf Winery and Prancing wolf ice wine.

(Unless it was just an education device made for us to discover how relationship creations are cumulative and make us practice relationships, in which case, this is all fine 8) )

17TYPO

Hi there!

The dates in the table containing Fight Club, April Fool’s Day, and Christmas appear to have some copy pasta. The “starts” date for Christmas Day reads “2018-02-15 19:30:00”, but it should be “2018-12-25 00:00:00”. It appears to be copied from the “ends” date of Fight Club.

Great book so far!

264ERROR

Or we can retrieve all hash keys.
redis 127.0.0.1:6379> HVALS user:luc
1) “name”
2) “password”

instead of

redis 127.0.0.1:6379> HKEYS user:luc
1) “name”
2) “password”

4242SUGGEST

Replace
cat `pg_config —sharedir`/tsearch_data/english.stop
with
cat `locate english.stop`

pg_config is installed only if the developer stuff has been installed.

96TYPO

On page 95, party was set to “D”, but on page 96 it’s listed as “I”.

10SUGGEST

Re: the table to pivot around for crosstab() in Day 2 of postgresql

An explicit list of values is no longer required by crosstab() in postgresql. Any values supplied are ignored.

Note: I’m reading the ACM Safari online version, so there are no page numbers. I just used 10 to be able to submit this comment.

187ERROR

MATCH (p1:Person {name: “Kofi”}),(p2:Person {name: “Tom”});
CREATE (p1)[r:friends]>(p2);

MATCH … ; CREATE …;

Between the MATCH and the CREATE, do not put a semicolon.

190ERROR

$ curl -i -XPOST ….. \\
-H “Content-Type: application/json” \\
-d ‘{
“name”: “P.G. Wodehouse”
“genre”: “British Humour”
}’

Missing a comma in the object that is being inserted.


“name”: “P.G. Wodehouse” ,
“genre”: “British Humour”

285ERROR

$ ruby data_dump_cluster.rb 10000
100000 items in 6.614907 seconds

You have to add a 0 to TOTAL_NUMBER_OF_ENTRIES to insert 100000 keys.

4329ERROR

The book suggests using the createlang command

$ createlang 7dbs —list

In pg 10, this gave an error:

Error: pg_wrapper: createlang was not found in /usr/lib/postgresql/10/bin

I found I could list the installed languages in the psql shell with \\dL. There may be other ways.

7dbs=# \\dL
List of languages
Name | Owner | Trusted | Description
—————————————+———————————————
plpgsql | postgres | t | PL/pgSQL procedural language
(1 row)

0ERROR

Section:
PostgreSQL ‘I’ll meet you at the cross tab’ (no page numbers in Safaribooksonline docs):

Problem:
When calling the function ‘crosstab’, an error occurs:
ERROR: function crosstab(unknown, unknown) does not exist

Solution:
The module ‘tablefunc’ has to be loaded:
CREATE EXTENSION tablefunc;

17TYPO

On this page we are tasked to create a table and enter three dates. I noticed that the third event called ‘Christmas Day’ has the same start date as the first one called ‘Fight Club’.

Which leads to an issue two pages later (19). There is an example for querying all dates where starts >= ‘2018-04-01’ and ‘Christmas Day’ won’t show up.

279TYPO

Redis, Day 2
In redis.conf file, it should be:

databases 16

instead of:

database 16

61ERROR

Hello!

I feel like there is a mistake in the chapter about HBase database. It is written that the column family is not specified and the colon is required. But the column family is defined, it is text. On the previous page, it is clearly written that we’re creating a table called wiki with a single column family called text. It seems like columns are not defined, but not the column family. Please correct me if I’m wrong.

198TYPO

When counting the number of actors Kevin Bacon played with, in the query result, it is written 304, and in the next paragraph — 313.

32ERROR

There is no WHERE clause in the EXPLAIN QUERY and therefore the output contains filters that where not stated.

23TYPO

The grouping example does not match the content of the events table. Following the previous examples, the table looks like this:

event_id | title | starts | ends | venue_id
———————————————————————-———————————————
1 | Fight Club | 2018-02-15 17:30:00 | 2018-02-15 19:30:00 | 2
2 | April Fools Day | 2018-04-01 00:00:00 | 2018-04-01 23:59:00 |
3 | Christmas Day | 2018-12-25 00:00:00 | 2018-12-25 23:59:00 |
7 | Wedding | 2018-02-26 21:00:00 | 2018-02-26 23:00:00 | 2
8 | Dinner with Mom | 2018-02-26 18:00:00 | 2018-02-26 20:30:00 | 3
9 | Valentine’s Day | 2018-02-14 00:00:00 | 2018-02-14 23:59:59 |

The output of the GROUP BY query should be this:

venue_id | count
—————+———-
2 | 2
3 | 1
| 3

23TYPO

The HAVING query is missing a count(*) in the SELECT statement. To match the printed result, it should be:

SELECT venue_id, count(*)
FROM events
GROUP BY venue_id
HAVING count(*) >= 2 AND venue_id IS NOT NULL;

25TYPO

The results of the query “SELECT title, count(*) OVER (PARTITION BY venue_id) FROM events” does not match the database whatsoever. The result should be:

title | count
————————+———
April Fools Day | 3
Christmas Day | 3
Dinner with Mom | 1
Fight Club | 2
Moby | 1
Valentine’s Day | 3
Wedding | 2

61ERROR

Page 61, Inserting, Updating and Retrieving Data, 3rd paragraph:
I says that we are no specifying the column family<. It should say column qualifier.

hbase apache org / book.html#datamodel

317TYPO

In the second part of CAP Adventure, the year 2009 is mentioned while 2019 seems to be a fit here.

18-19TYPO

‘LARP Club’ should be ‘Fight Club’

Categories: