2100 Clearwater Dr. Suite 330, Oak Brook IL 60523

1-(708) 575-2090 contact@pmsquare.com Visit our other locations: australia singapore philippines

Google BigQuery in Cognos Analytics

fast-line1

Let Cognos Analytics do some Googling

Did you realize that you can connect your Cognos Analytics system to a cloud-based big data analytics warehouse? You can, and it’s not that difficult to set up Google BigQuery in Cognos Analytics.

Google’s BigQuery analytics warehouse offering is pretty compelling. While people are generally more familiar with Amazon RedShift as a cloud-based data warehouse, Google compares favorably in a number of ways (see this Reddit thread for details—it’s driven by a Google employee, but the thread participants familiar with RedShift don’t seem to dispute many points).

https://www.reddit.com/r/bigdata/comments/3jnam1/whats_your_preference_for_running_jobs_in_the_aws/cur518e/

In the latest version of Cognos Analytics (11.0.6), you now have the ability to query a BigQuery data source from Cognos Analytics, displaying the results in a dashboard, report, visualization, story, etc. Since IBM has yet to provide many details about how exactly to get this working, I’ve written up the process here to get you going. In fact, this article will even walk you through the steps of setting up a free test account with BigQuery so that you can experiment to see if this is a solution that could benefit your organization. (Cognos Analytics can connect to RedShift as well, but doing so is outside the scope of this article).  So let’s dive in to connecting Google BigQuery in Cognos Analytics

Steps to Set Up Google BigQuery

  1. Open up a web browser and navigate to https://bigquery.cloud.google.com/
  2. If you’re the rare breed that doesn’t have a google account, you’ll need to create one before proceeding. Otherwise, login with your Google account.
  3. Be thorough and review the Terms of Service

 

BigQuery in Cognos-1

 

  1. If you accept the Terms of Service, you’ll be rewarded with a welcome screen with a bit of info about BigQuery. Click “Create a Project”

 

bigquery-in-cognos-2

 

  1. Oddly enough, when I’ve gone through this process (and I’ve done it a few times), it never actually creates a project. Instead, it just dumps me in the API Manager Library. No mind, just click “Select a Project” at the top of the screen.

 

bigquery-in-cognos-3

 

  1. Then click the “plus” sign to create a new project

 

bigquery-in-cognos-4

 

  1. Give your project a tremendously creative name such as I did below, and click “Create”. Make a note of your “project ID”, as you will need it later (though you can always come back and look it up if you lose track of it, of course).

 

bigquery-in-cognos-5

 

  1. Again, counter-intuitively your project is not automatically selected when you create it, so once you get dumped back to the API Manager, you’ll need to click “Select a project” again and choose the project you just created. (Apparently Google developers are way too busy building mind-bending search algorithms to run through the handful of steps to set up their application.)
  2. Then, click the “hamburger” in the top left, and select “IAM & Admin” from the resulting menu.

 

bigquery-in-cognos-6

 

  1. Now we’re going to create a service account that Cognos will later use to authenticate to BigQuery. In order to do this, click “Service accounts” on the left and then “Create service account”

 

bigquery-in-cognos-7

 

  1. Give your service account a fascinating name, and specify the role(s) for the account. I haven’t tested or read up on this extensively, but selecting the three shown in the screenshot seem to hit the sweet spot of allowing what is needed for the connection to function without giving unnecessary permissions. Note the Service account ID that is generated, as you’ll need this later.

 

bigquery-in-cognos-8

 

  1. Check the “Furnish a new private key” box, and choose JSON. Then click “Create”.

 

bigquery-in-cognos-9

 

  1. Store the JSON file that is generated somewhere safe, as you’ll need it later

 

bigquery-in-cognos-10

 

  1. Okay, back to idiosyncratic setup steps… Type https://bigquery.cloud.google.com/ in your browser address bar again. You should see the “Welcome to BigQuery!” screen again. But this time click “an existing project” at the end of the paragraph under “Get started”.

 

bigquery-in-cognos-11

 

  1. Click “Continue”

 

bigquery-in-cognos-12

 

  1. You’re finally ready to create a dataset! Click the down arrow next to the name of your project, and select “Create new dataset”.

 

bigquery-in-cognos-13

 

  1. Come up with one more compelling name and type it in as your Dataset ID. This will show up as a table in Cognos Analytics.

 

bigquery-in-cognos-14

 

  1. I’m not going to into Google’s sample data or how to query some data here—just reference the BigQuery quickstart guide: https://cloud.google.com/bigquery/quickstart-web-ui (as I understand it, in order to actually pull some data you’ll have to enable billing, but they have a free tier and won’t charge you anything without you taking further action. I recommend verifying this through Google’s official documentation before entering billing info.)

 

Connecting BigQuery in Cognos Analytics

  1. First, download the drivers that Cognos will use to access BigQuery

https://cloud.google.com/bigquery/partners/simba-drivers/?cm_mc_uid=36135378392514752529022&cm_mc_sid_50200000=1495664315

You’ll want to download the current “JDBC 4.1-compatible” version of the drivers.

  1. Extract the contents of the zip file into a temporary folder.
  2. Copy all .jar files from the temporary folder to your Cognos Analytics drivers folder (should be something like (D:\IBM\Cognos\analytics\drivers).
  3. Stop/start your Cognos Analytics services from Cognos Configuration. (You MAY be able to get away with just restarting your query service from Cognos Administration, but I recommend just restarting all services from Cognos Configuration unless you’re working in an environment where are not able to do so.)
  4. Open up Cognos Analytics in a browser and navigate to Manage > Data server connections

 

 

bigquery-in-cognos-15

 

 

  1. Click the circled + sign to create a new connection

 

bigquery-in-cognos-16

 

  1. Choose Google BigQuery as your type.

 

bigquery-in-cognos-17

 

 

  1. Type in the JDBC URL.

 

The syntax you will need to use is as such:

jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=[ProjectID];OAuthType=0;OAuthServiceAcctEmail=[ServiceAccountID];OAuthPvtKeyPath=[PathToPrivateKeyFile];

 

For example:

jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=New_Test_Dataset;OAuthType=0;OAuthServiceAcctEmail=c11-715@c11-bigquery.iam.gserviceaccount.com;OAuthPvtKeyPath=D:\IBM\Cognos\analytics\drivers\SimbaJDBCDriverforGoogleBigQuery41_1.0.6.1008\C11-BigQuery-41de6afd1958.json;

NOTE: You can leave authentication set to “Connect anonymously”, although that’s not really what’s happening—the private key file referenced in the JDBC URL is being utilized for authentication.

 

BigQuery in Cognos -18

 

  1. Click “Test” to verify your connection is working properly. If it is, click “Save”. You’re good to go! I recommend creating a data module to test your connection.

 

Troubleshooting

If you have problems, check the following:

  1. It seems Cognos is only compatible with the 4.1 version of the JDBC drivers
  2. I’ve only had success when copying all the .jar files into the root of the Cognos drivers folder. You can’t use a subfolder for organization.
  3. If you’ve only tried restarting the query Service from Cognos Administration, try restarting all services from there. If you still have problems, stop and start all Cognos services completely in Cognos Configuration.
  4. Verify your JDBC URL
    1. Make sure you are using the Project and Service Account IDs rather than names and that they are exactly correct
    2. Make sure your JSON file name and path is accurate and accessible by Cognos
  5. Verify you can hit Google BigQuery URL included in the JDBC URL from your Cognos server over port 443 (in other words, make sure this isn’t blocked by a firewall).

 

Conclusion

Now you’re ready to source data from Google BigQuery, and start using your Cognos Analytics system to pull in the results from big data queries, with serious horsepower behind you!  I hope you find this article helpful.  If you haven’t already, be sure to check out our blog for additional tips and tricks.  Subscribe to our e-newsletter for more technical articles and updates delivered directly to your inbox.

 

SUBSCRIBE

 

If you would like to learn more how PMsquare can help your organization please reach out to us at:

United States Australia Singapore, Philipines, Thailand
PMsquare LLC Cornerstone PMsquare | A Cornerstone Company
P: 708-575-2092
E: Chris Loechel
P:+61 1300 840 048
E: Piers Wilson
P:+65 6635 1700
E: Carsten Brandt

Blog post shared courtesy of PMsquare LLC