def odps_to_xlab_type()

in src/ab/plugins/db/odps_helper.py [0:0]


    def odps_to_xlab_type(data_type):
        """
        MaxCompute 2.0 new data types:
        http://help.aliyun-inc.com/internaldoc/detail/27821.html
        """
        _type = str(data_type).lower()
        if any(string_type in _type for string_type in ['string', 'varchar']):
            return 'String'
        elif 'int' in _type:
            return 'Long'
        elif _type == 'boolean':
            return 'Boolean'
        elif any(float_type in _type for float_type in ['float', 'double', 'decimal']):
            return 'Double'
        elif any(date_type in _type for date_type in ['date', 'time']):
            return 'Date'
        else:
            raise TypeError('不支持的odps数据类型: {_type}'.format(_type=_type))