예제 #1
0
def _decimal_promoted_type(args):
    precisions = []
    scales = []
    for arg in args:
        if isinstance(arg, ir.DecimalValue):
            precisions.append(arg.meta.precision)
            scales.append(arg.meta.scale)
    return ir.DecimalType(max(precisions), max(scales))
예제 #2
0
    def _adapt_types(self, descr):
        names = []
        adapted_types = []
        for col in descr:
            names.append(col[0])
            impala_typename = col[1]
            typename = _impala_to_ibis_type_mapping[impala_typename.lower()]

            if typename == 'decimal':
                precision, scale = col[4:6]
                adapted_types.append(ir.DecimalType(precision, scale))
            else:
                adapted_types.append(typename)
        return names, adapted_types
예제 #3
0
def _decimal_scalar_ctor(precision, scale):
    out_type = ir.DecimalType(precision, scale)
    return ir.DecimalScalar._make_constructor(out_type)