hyrise/hyrise — pull request #291 by grundprinzip (2014-01-08 08:48:23+00:00)
Title: WIP: Refactoring Type System

## Refactoring the Type System

This pull requests is a rather large refactoring around the type system. The source for this request is that we currently support three basic types but with another three types of dictionaries. To come to a point where we might support any more we need to upgrade the system.

As a consequence I refactored the type system in the following way. From the outside we have now 10 different types:

* INTEGER , FLOAT, STRING
* [INTEGER | FLAOT | STRING]_MAIN
* [INTEGER | FLAOT | STRING]_CONC
* INTEGER_NO_DICT

Depending on the type it is now possible to select the correct dictionary, which can make casting easier. Since we now now, that a column of type INTEGER_MAIN is using an ordered dictionary. The mapping between dictionaries and types is specified in `src/lib/storage/DictionaryFactory.h`. At the same time we define underlying types that allow the direct storage. This means that INTEGER uses `int64_t` and so does INTEGER_MAIN, INTEGER_CONC. This mapping is defined in `src/lib/storage/meta_storage.h`. For fast plan operations working on the direct storage this makes it easier to distinguish which code paths to take. For generic plan operations it is possible to verify if the types are compatible using `isCompatible(DataType, DataType)`.

If you need to extract and upgrade / downgrade a type use the helper functions specified in `src/lib/storage_types.h` that allow you to extract the ordered or unordered type.

### PassThroughDictionary

To allow columns that can store their data type directly within the 32bit of the value ID I added a new Dictionary called `PassThroughDictionary` is acts like a cast and does not store any state. It allows to transparently integrate non dictionary columns within the system. When Loading the data or specifying columns use the `INTEGER_NO_DICT` type string.

## Additional Changes

The ColumnMetadata object is no longer a pointer, but is passed by value to avoid leaking and such.