20190219

Apache Hive and java.lang.ClassCastException on start

Photo by Annie Spratt on Unsplash

A couple of days ago I installed Hive from Homebrew on my Mac. Sadly, when I tried to run the hive command, I got the weird-looking error

Exception in thread "main" java.lang.ClassCastException: 
  class jdk.internal.loader.ClassLoaders$AppClassLoader 
   cannot be cast to 
  class java.net.URLClassLoader 
  (jdk.internal.loader.ClassLoaders$AppClassLoader 
    and 
  java.net.URLClassLoader are in module java.base of loader 'bootstrap')

That looked like a JVM incompatibility, so I switched from GraalVM (the one I use by default) to Java 8 (I have aliases jgrce, jgree, j8 and j11 to switch JVMs). Still, the same error regardless. Weird. Maybe Java 11 (the other JVM I have installed)? Nope, same error.

A quick Googling confirmed that this was related to Hive picking up Java 11, but only working with 7, 8 or 9 (not sure about 9). This in turn is due to the Hive boot scripts looking for the latest JRE which is at least 7, like the hive command here:

JAVA_HOME="$(/usr/libexec/java_home --version 1.7+)" \ 
HIVE_HOME="/usr/local/Cellar/hive/3.1.1/libexec" exec \
"/usr/local/Cellar/hive/3.1.1/libexec/bin/hive" "$@"

This will pick 11, which no longer has URLClassLoader (I think this was changed in Java 9). So, won't start.

Sadly the only reasonable fix is modifying the scripts after installation, unless you want to just uninstall Java > 1.8. For me this was not an option, so I just modified the scripts by removing the JAVA_HOME condition (since I set my JAVA_HOME globally when I switch between JVMs). And crossing fingers to remember I did so next time I upgrade HomeBrew.

Written by Ruben Berenguel

20190217

2019-6 Readings of the week

NOTE: The themes are varied, and some links below are affiliate links. Softwareengineering, adtech, psychology, python. Expect a similar wide range in the future as well. You can check all my weekly readings by checking the tag here . You can also get these as a weekly newsletter by subscribing here.

Finding Lena Forsen, the Patron Saint of JPEGs

I have written about Lena Forsen (previously Soderberg) before. This is an article explaining the story behind the classic picture, the issues that have arisen with it after the years and a bit of the take of the subject, Lena.

Incrementally migrating over one million lines of code from Python 2 to Python 3

Did you know, Dropbox (the client) is written in Python? Well, I did, but wasn't aware of its scale. And, now it's mostly Python 3, which is good to know. Bonus points for Dropbox for using pytest as well.

How Criteo is trying to navigate GDPR

Since I work in adtech, I need to keep up with what's up and how everything is going. This article explains a bit the impact of GDPR on Criteo, one of the largest players in programmatic advertising in Europe. By the way, Criteo have a superb engineering blog, although it can be a bit hard to read through an adblocker. By the way, the linked post is behind a paywall. Paste the URL of the link on Google and click on the first search result to be able to read it if interested.

10 Reasons Why GTD Might Be Failing

The title of the linked article should end in for you. It lists the common problems a GTD newbie-intermediate can face. Been there, done that. Still am, probably.

Reflecting on My Failure to Build a Billion Dollar Company

The story of GumRoad, the publishing site. A very interesting view on startups.

StranglerApplication

One of Martin Fowler's refactoring approaches. I'm pretty sure you've done this, turns out it has a name.

The de Havilland Comet

The story of the first passenger jet disasters, and why they happened.

Simple dependent types in Python

They may be a bit too simple for what you may be looking for, but the potential is there. Also, linked to the following, which I found ideal.

1-minute guide to real constants in Python

There's actually a Final type coming, someday, to Python, which will make constants real constants. Looking forward to that.

The Dunning-Kruger effect, and how to fight it

There is a quote in this interview of David Dunning which is just brilliant:
The first rule of the Dunning-Kruger club is you don’t know you’re a member of the Dunning-Kruger club. People miss that.”

📚Atomic Habits

This week I have finished Atomic Habits (affiliate link). I didn't expect much, after having read so many productivity books during my life. And indeed, there was nothing new I hadn't read before, but the presentation, examples and overall feel of the book have been excellent, I have rated it 5 stars in Goodreads, which is not something I do frequently (once per year, approximately).

Newsletter?

These weekly posts are also available as a newsletter. These days (since RSS went into limbo) most of my regular information comes from several newsletters I’m subscribed to, instead of me going directly to a blog. If this is also your case, subscribe by clicking here.
Written by Ruben Berenguel

20190210

2019-5 Readings of the week

NOTE: The themes are varied, and some links below are affiliate links. Software/data engineering, psychology, formal systems. Expect a similar wide range in the future as well. You can check all my weekly readings by checking the tag here . You can also get these as a weekly newsletter by subscribing here.

Playing with Rust

I've known Pere for several years, and I'm glad to see his views on Rust. Looks like not every Scala developer has to move from Scala to Haskell.

Try out walrus operator in Python 3.8

I am the egg man, they are the egg men, I am the PEP 572: Goo goo g'joob. Well, or not. This feels very un-pythonic, and we all know the amount of flak BDFL got for that. But oh well, it's in Python 3.8-dev. Let this serve as the weekly reminder that pyenv is excellent.

Cognitive Journaling: A Systematic Method to Overcome Negative Beliefs

Last year I had been journaling on and off, and this year I have been consistent, every day so far since New Year. This has interesting approaches to understand your mind better.

How Jeff Bezos Turned Narrative into Amazon's Competitive Advantage

This idea is gold, but the HackerNews comments are better than the original article.

Model Metropolis

I read about Forrester's Urban Dynamics in the excellent Thinking in Systems from Donella Meadows. And this also talks about SimCity, what else could I want?

A Humility Training Exercise for Technical Interviewers

The idea presented here is powerful: learn to remove biases from your interviews. As an occasional interviewer (and interviewee), I can totally see how this can help.

pandas blog – Pandas Extension Arrays

Extension arrays show a lot of promise, and right now there is work underway for Pandas extension arrays based on Arrow (fletcher). Although the cool work will happen when the underlying memory layout and building blocks of Pandas are actually Arrow... And that is underway as well.

Demystifying JOIN Algorithms

A very good explanation of basic join algorithms, with a pseudocode that looks pretty much like Python

Newsletter?

These weekly posts are also available as a newsletter. These days (since RSS went into limbo) most of my regular information comes from several newsletters I’m subscribed to, instead of me going directly to a blog. If this is also your case, subscribe by clicking here.
Written by Ruben Berenguel