예제 #1
0
def add_operation(op, func_name, db):
    """
    Registers the given operation within the Ibis SQL translation toolchain

    Parameters
    ----------
    op: operator class
    name: used in issuing statements to SQL engine
    database: database the relevant operator is registered to
    """
    full_name = '{0}.{1}'.format(db, func_name)
    if isinstance(op.input_type, rules.VarArgs):
        translator = comp.varargs(full_name)
    else:
        arity = len(op.input_type.types)
        translator = comp.fixed_arity(full_name, arity)

    comp._operation_registry[op] = translator
예제 #2
0
파일: udf.py 프로젝트: BabelTower/ibis
def add_operation(op, func_name, db):
    """
    Registers the given operation within the Ibis SQL translation toolchain

    Parameters
    ----------
    op: operator class
    name: used in issuing statements to SQL engine
    database: database the relevant operator is registered to
    """
    full_name = '{0}.{1}'.format(db, func_name)
    if isinstance(op.input_type, rules.VarArgs):
        translator = comp.varargs(full_name)
    else:
        arity = len(op.input_type.types)
        translator = comp.fixed_arity(full_name, arity)

    comp._operation_registry[op] = translator