示例#1
0
    def formatter(translator, expr):
        op = expr.op()
        _, parameter = op.args
        # arg_formatted = translator.translate(arg)
        parameter_formatted = translator.translate(parameter)
        return '{}({})'.format(name, parameter_formatted)

    return formatter


# operation map

_binary_infix_ops = {
    # math
    ops.Power: fixed_arity('power', 2),
    ops.NotEquals: impala_compiler._binary_infix_op('<>'),
}

_unary_ops = {}

# COMPARISON
_comparison_ops = {}

# MATH
_math_ops = {
    ops.Degrees: unary('degrees'),  # OmniSciDB function
    ops.Modulus: fixed_arity('mod', 2),
    ops.Pi: fixed_arity('pi', 0),
    ops.Radians: unary('radians'),
    NumericTruncate: fixed_arity('truncate', 2),
    ops.Log: _log,
示例#2
0
    output_type = rlz.shape_like('arg', ops.dt.float)


# String


class ByteLength(ops.StringLength):
    """Returns the length of a string in bytes length"""


# https://www.mapd.com/docs/latest/mapd-core-guide/dml/
_binary_infix_ops = {
    # math
    ops.Power: fixed_arity('power', 2),
    ops.NotEquals: impala_compiler._binary_infix_op('<>'),
}

_unary_ops = {}

# COMPARISON
_comparison_ops = {}


# MATH
_math_ops = {
    ops.Degrees: unary('degrees'),  # MapD function
    ops.Modulus: fixed_arity('mod', 2),
    ops.Pi: fixed_arity('pi', 0),
    ops.Radians: unary('radians'),
    NumericTruncate: fixed_arity('truncate', 2),