Fixing NullPointerException thrown while cube select queries

Attaching first part of the fix for the cube select dimension table.

This commit alone does not fix the issue.

There are fixes to be done on hive along with grill. 

The problems in hive are as following:

* The rewrite of the query fail with 

```
java.util.MissingFormatArgumentException: Format specifier 's'
```

This is due to the fact that we are not adding partitions into rewritten select query for dimension table.

* The time field for the dimension table in example is returned as Null.