Professional Documents
Culture Documents
Analytics Engineering With SQL and DBT: Building Meaningful Data Models at Scale 1st Edition Rui Pedro Machado
Analytics Engineering With SQL and DBT: Building Meaningful Data Models at Scale 1st Edition Rui Pedro Machado
https://textbookfull.com/product/advanced-analytics-with-spark-
patterns-for-learning-from-data-at-scale-2nd-edition-sandy-ryza/
https://textbookfull.com/product/building-mobile-apps-at-
scale-39-engineering-challenges-gergely-orosz/
https://textbookfull.com/product/sql-server-data-automation-
through-frameworks-building-metadata-driven-frameworks-with-t-
sql-ssis-and-azure-data-factory-andy-leonard/
https://textbookfull.com/product/large-scale-data-analytics-
chung-yik-cho/
SQL for Data Analytics: Harness the power of SQL to
extract insights from data, 3rd Edition Jun Shan
https://textbookfull.com/product/sql-for-data-analytics-harness-
the-power-of-sql-to-extract-insights-from-data-3rd-edition-jun-
shan/
https://textbookfull.com/product/business-models-innovation-
digital-transformation-and-analytics-data-analytics-
applications-1st-edition-iwona-otola-editor/
https://textbookfull.com/product/big-data-analytics-for-large-
scale-multimedia-search-stefanos-vrochidis/
https://textbookfull.com/product/practical-natural-language-
processing-with-python-with-case-studies-from-industries-using-
text-data-at-scale-1st-edition-mathangi-sri/
https://textbookfull.com/product/data-analytics-for-business-ai-
ml-pbi-sql-r-wolfgang-garn/
Analytics Engineering with
SQL and dbt
Building Meaningful Data Models at Scale
Constant width
Used for program listings, as well as within paragraphs to refer to
program elements such as variable or function names, databases,
data types, environment variables, statements, and keywords.
TIP
This element signifies a tip or suggestion.
NOTE
This element signifies a general note.
NOTE
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.
How to Contact Us
Please address comments and questions concerning this book to the
publisher:
O’Reilly Media, Inc.
Sebastopol, CA 95472
707-829-0104 (fax)
support@oreilly.com
https://www.oreilly.com/about/contact.html
We have a web page for this book, where we list errata, examples,
and any additional information. You can access this page at
https://oreil.ly/analytics-engineering-SQL-dbt.
For news and information about our books and courses, visit
https://oreilly.com.
Find us on LinkedIn: https://linkedin.com/company/oreilly-media
Follow us on Twitter: https://twitter.com/oreillymedia
Watch us on YouTube: https://youtube.com/oreillymedia
Acknowledgments
I want to send a special message to my wife, Ana, and my two
wonderful daughters, Mimi and Magui. You inspire me every day to
believe in myself and to pursue my dreams unwaveringly because
what I achieve for me, I achieve for us. Above all, I want to show
my daughters that anything is possible when we set our minds to it.
Lastly, I need to thank Hélder, friend and coauthor, for keeping this
dream alive and having levels of resilience I have never seen before
in anyone.
Rui Machado
I want to thank my (future) wife for always being by my side. Her
patience and words were my rock in the toughest times. Also, a
special thank you to my parents. Without them and their efforts to
allow me to continue my studies and pursue my dreams, certainly
this book wouldn’t be possible. Again, my genuine thank you to
them. Finally, to all my anonymous and not-so-anonymous friend(s)
and coauthor, Rui, who stood by my side with their positivity and
constructive feedback, and substantially enriched the content of this
book.
Hélder Russa
Chapter 1. Analytics
Engineering
END OF PART I.
PART II.
CHAPTER I.
ELISSA.
All the lower parts of Spain had been conquered and settled.
Hamilcar had died, as he had lived, fighting nobly, after enjoying
almost regal rank in his new country. Hasdrubal, who had succeeded
him, was also dead, and now Hannibal, Hamilcar’s son, a man in the
young prime of life, held undisputed sway throughout the length and
breadth of the many countries of Iberia that his father’s arms and his
father’s talents had won for Carthage.
In the delightful garden of a stately building reared upon a hill
within the walls of the city of Carthagena or New Carthage, a group
of girls and young matrons were assembled under a spreading tree,
just beyond whose shade was situated a marble fish pond, filled with
graceful gold and silver fishes. The borders of the pond were fringed
with marble slabs, and white marble steps led down into the basin for
bathing purposes. In the centre a fountain threw up in glittering spray
a jet of water which fell back with a tinkling sound into the basin.
Upon the marble steps, apart from the other young women, sat a
maiden listlessly dabbling her fingers and one foot in the water, and
watching the fishes as they darted hither and thither after some
insect, or rose occasionally to the surface to nibble at a piece of
bread which she threw them from time to time. The girl, who was in
her seventeenth year, was in all the height of that youthful beauty
which has not yet quite developed into the fuller charms of
womanhood, and yet is so alluring with all the possibilities of what it
may become.
Of Carthaginian origin on the father’s side, her mother was a
princess of Spain—Camilla, daughter of the King of Gades. She had
inherited from the East the glorious reddish black hair and dark liquid
eyes, and had derived from the Atlantic breezes, which had for
centuries swept her Iberian home, the brilliant peach-like colouring
with its delicate bloom, seeming as though it would perish at a touch,
which is still to be seen in the maidens of the modern Seville. For
this city of Andalusia had been, under the name of Shefelah, a part
of her grandfather’s dominions. Tall she was and graceful; her
bosom, which was exposed in the Greek fashion on one side, might
have formed the model to a Phidias for the young Psyche; her ivory
arms were gently rounded and graceful. Her rosy delicate foot was of
classical symmetry, and the limb above, displayed while dabbling in
the water, was so shapely, with its small ankle and rounded curves,
that, as she sat on the marble there by the fish pond in her white
flowing robes, an onlooker might well have been pardoned had he
imagined that he was looking upon a nymph, a naiad just sprung
from the waters, rather than upon the daughter of man.
But it was in the face that lay the particular charm. Above the
snow-white forehead and the pink, shell-like ear, which it partially
concealed, lay the masses of ruddy black hair bound with a silver
fillet. The delicious eyes, melting and tender, beamed with such
hopes of love and passion that had the observer been, as indeed
were possible, content for ever to linger in their dusky depths of
glowing fire, he might have exclaimed, “a woman of passion, one
made for love only, nothing more!” Yet closer observation disclosed
that above those eyes curved two ebony bows which rivalled Cupid’s
arc in shape, and which, although most captivating, nevertheless
expressed resolution. The chin, although softly rounded, was also
firm; the nose and delicious mouth, both almost straight, betokened
a character not easily to be subdued, although the redness and
slight fulness of the lips seemed almost to proclaim a soft sensuous
side to the nature, as though they were made rather for the kisses of
love than to issue commands to those beneath her in rank and
station.
Such, then, is the portrait of Elissa, Hannibal’s daughter.
The other ladies, including her aunt, the Princess Cœcilia, widow
of Hasdrubal, a buxom, merry-looking woman of thirty, kept aloof,
respecting her reverie. For, notwithstanding her youth, the lady
Elissa was paramount, not only in the palace, but also in the New
Town or City of Carthagena during the absence of her father
Hannibal and her uncles Hasdrubal and Mago at the siege of the
Greek city of Saguntum, and had been invested by Hannibal, on his
departure, with all the powers of a regent. For, being motherless
almost from her birth, Hannibal, a young man himself, had been
accustomed to treat her as a sister, almost as much as a daughter.
He had been married when a mere lad, for political reasons, by his
father Hamilcar, and Elissa had been the sole offspring of the
marriage. Since her mother’s death he had remained single, and
devoted all his fatherly and brotherly love to training his only
daughter to have those same noble aims, worthy of the lion’s brood
of Hamilcar, which inspired all his own actions in life. And these aims
may be summed up in a few words: devotion to country before
everything; self abnegation, ay, self sacrifice in every way, for the
country’s welfare; ambition in its highest sense, not for the sake of
personal aggrandisement, but for the glory of Carthage alone. No
hardships, no personal abasement even—further, not even extreme
personal shame, or humiliation if needful, was to be shrunk from if
thereby the interests of Carthage could be advanced. Self was
absolutely and at all times to be entirely set upon one side and
placed out of the question, as though no such thing as self existed;
the might, glory, and power of the Carthaginian kingdom were to be
the sole rule, the sole object of existence, and with them the undying
hatred of and longing for revenge upon Rome and the Romans, as
the greatest enemies of that kingdom, through whom so many
humiliations, including the loss in war of Sicily, and the loss by fraud
of Sardinia, had been inflicted upon the great nation founded by
Dido, sister of Pygmalion, King of Tyre.
These, then, were the precepts that Hannibal had ever, from her
earliest youth, inculcated in his daughter; and with the object that
she might learn early in life to witness and expect sudden reverses
of fortune, he had hitherto, since her twelfth year, ever taken her with
him upon his campaigns against the Iberian tribes. Thus she might