Yak Shaving with the IntelliJ 13 SQL Query Plugin


My 9 year old daughter wanted to play a Pokemon battle with me this afternoon. I started to tell her, “I’ll be right there after I finish shaving this yak…” I’m sure folks would pay good money to see the confused look on her face if I were to have actually said that. Hi, I’m Cliff. You’re here because you shave yaks for a living. I’m here because I just finished vacuuming about 200 lbs of yak hair from my kitchen floor.

Pokemon Battle
Pokemon Battle

What in the world are you yaking about?

If you’re as late to the latest tech jargon that came out lately as I am then you probably never heard of the saying. Yak shaving is a term, which I recently heard/learned on the last few Hanselminutes podcasts. (If you haven’t heard of Scott Hanselman yet, check him out.) It was actually coined by Carlin Vieri in his time at the MIT AI Lab (1993-8) after viewing a 1991 episode of The Ren and Stimpy Show featuring “Yak Shaving Day,” a Christmas-like Holiday where participants hang diapers instead of stockings, stuff rubber boots with cole slaw, and watch for the shaven yak to float by in his enchanted canoe. It refers to the “meta-tasks” that you have to complete before you continue the real work you set out to do. An example would be if you were to write an iPhone app for a friend in an attempt to become the next Instagram. Your friend would likely come to you within a week to ask how’s the app coming along. You would likely reply, “I’ve registered for my developer account, downloaded the SDK, and I’m searching the forums while I try to resolve this provisioning profile issue I have on my iPad because it’s registered under multiple accounts.” It’s pretty common to start a mobile app this way having half a week go by without having written one line of code. So in essence you’re “shaving a yak” when you should be plotting UI components in Xcode’s StoryBoard.

About my Yak
I was busy processing some financial spreadsheets with Groovy scripts trying to load them in an instance of the Java embedded Derby Database when I ran into several issues. First, I couldn’t remember all of the SQL commands and Groovy stuff I used to use over 10 years ago when I was heavy into database number crunching. I went on a minor tangent to learn how to setup Derby, re-learn the GDK, prepared statements, etc. Next I needed to verify my data was being loaded correctly. The Derby ij command line interface was frustrating me so I decided to install a SQL plugin in IntelliJ. The most popular one, DB Navigator, wouldn’t work with my Derby db so I found the other more popular plugin… SQL Query. This plugin almost worked but it wouldn’t let me add a custom driver as there was an API change.

com.intellij.openapi.fileChooser.FileChooser.chooseFiles nosuchmethod

I Googled the error and found a hit on the Atlassian Clover plugin which had apparently fixed the same API change. While trying to find the diff in there plugin source I had to remember how I back-track bug fixes in Jira at work. I quickly realized that Clover was not open source so I investigated another hit and found the actual one-liner that fixes the error. I then needed to find the most recent copy of the SQL Query plugin source. After downloading I had to learn how to write Idea plugins, a topic which is well documented but still takes effort/practice. Along the way I ended up checking out the entire source for Idea as part of the plugin development setup instructions. (Have I ever mentioned how much I hate downloading excessive source?) I fought with dependency issues in the plugin itself as half of its dependencies were bundled as src jars and the other half was not included. Long story lengthened, I hacked the build.xml, downloaded the necessary dependencies, setup run/debug configs, uninstalled my existing SQL Query plugin to avoid potential conflicts (I don’t think it was necessary but just to be safe…) flushed the toilet several times, almost choked on a cup of coffee. In the end I managed to get both my data loaded into Derby and a working plugin that I can use to visualize the data in my IDE.

If I had just one more hour to spare I would format the above paragraph in the shape of a yak but I think you get my point. I feel awkwardly proud of myself, yet also disappointed. On the one hand I learned/compiled/debugged/built my 1st modified IntelliJ Idea plugin and I did it all in about an hour or two. I notified the original author and emailed him my updates. I will also have a pretty decent blog article documenting my experience. On the other hand half the day is gone and I only have one database table loaded and no understanding of the data I set out to mine. Still I am proud having self served my plugin error. It is a rewarding feeling to be on the development side of a fix where I’m usually begging the author, “please could you fix this error? It happens when I click here.” That sort of pleading is usually accompanied with arduous IDE log files, stripped-down or recoded pieces of whatever project I’m working on to preserve IP, frustration and an awkward smile when the author replies with, “could you send me the OTHER log files and which version of the thing are you running?”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s