'is v1 higher than v2
>>> DruidDatasource.version_higher(\'0.8.2\', \'0.9.1\')
False
>>> DruidDatasource.version_higher(\'0.8.2\', \'0.6.1\')
True
>>> DruidDatasource.version_higher(\'0.8.2\', \'0.8.2\')
False
>>> DruidDatasource.version_higher(\'0.8.2\', \'0.9.BETA\')
False
>>> DruidDatasource.version_higher(\'0.8.2\', \'0.9\')
False'

@staticmethod
def version_higher(v1, v2):

    def int_or_0(v):
        try:
            v = int(v)
        except (TypeError, ValueError):
            v = 0
        return v
    v1nums = [int_or_0(n) for n in v1.split('.')]
    v2nums = [int_or_0(n) for n in v2.split('.')]
    v1nums = (v1nums + [0, 0, 0])[:3]
    v2nums = (v2nums + [0, 0, 0])[:3]
    return ((v1nums[0] > v2nums[0]) or ((v1nums[0] == v2nums[0]) and (v1nums[1] > v2nums[1])) or ((v1nums[0] == v2nums[0]) and (v1nums[1] == v2nums[1]) and (v1nums[2] > v2nums[2])))
