def dshape_to_hive(ds):
    """ Convert datashape measure to Hive dtype string

    >>> dshape_to_hive('var * {name: string, balance: int32}')
    ['name  STRING', 'balance  INT']
    >>> dshape_to_hive('int16')
    'SMALLINT'
    >>> dshape_to_hive('?int32')  # Ignore option types
    'INT'
    >>> dshape_to_hive('string[256]')
    'VARCHAR(256)'
    """
    if isinstance(ds, (str, unicode)):
        ds = datashape.dshape(ds)
    if isinstance(ds, ct.DataShape):
        ds = ds.measure
    if isinstance(ds, ct.Record):
        columns = [(name, dshape_to_hive(typ))
                for name, typ in zip(ds.measure.names, ds.measure.types)]
        return ['%s  %s' % col for col in columns]
    if isinstance(ds, ct.Option):
        ds = ds.ty
    if isinstance(ds, ct.String):
        if ds.fixlen:
            return ds.fixlen % 'VARCHAR(%d)'
        else:
            return 'STRING'
    if ds in hive_types:
        return hive_types[ds]
    raise NotImplementedError("No Hive dtype known for %s" % ds)
dataset/ETHPy150Open blaze/odo/odo/backends/hdfs.py/dshape_to_hive/swapped operands of `%`