Ejemplo n.º 1
0
class RPad(ValueOp):

    input_type = [
        string,
        integer(name='length'),
        string(name='pad', optional=True)
    ]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 2
0
class Substring(ValueOp):

    input_type = [
        string,
        integer(name='start'),
        integer(name='length', optional=True)
    ]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 3
0
class StringFind(ValueOp):

    input_type = [
        string,
        string(name='substr'),
        integer(name='start', optional=True, default=None),
        integer(name='end', optional=True, default=None)
    ]
    output_type = rules.shape_like_arg(0, 'int64')
Ejemplo n.º 4
0
class Truncate(ValueOp):

    input_type = [
        rules.timestamp,
        rules.string_options(_truncate_units,
                             name='unit',
                             validator=_truncate_unit_validate)
    ]
    output_type = rules.shape_like_arg(0, 'timestamp')
Ejemplo n.º 5
0
class NotNull(UnaryOp):
    """
    Returns true if values are not null

    Returns
    -------
    notnull : boolean with dimension of caller
    """

    output_type = rules.shape_like_arg(0, 'boolean')
Ejemplo n.º 6
0
class StringLength(UnaryOp):
    """
    Compute length of strings

    Returns
    -------
    length : int32
    """

    output_type = rules.shape_like_arg(0, 'int32')
Ejemplo n.º 7
0
class ParseURL(ValueOp):

    input_type = [
        string,
        rules.string_options([
            'PROTOCOL', 'HOST', 'PATH', 'REF', 'AUTHORITY', 'FILE', 'USERINFO',
            'QUERY'
        ],
                             name='extract'),
        string(name='key', optional=True)
    ]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 8
0
class StringUnaryOp(UnaryOp):

    input_type = [string]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 9
0
class RegexExtract(ValueOp):

    input_type = [string, string(name='pattern'), integer(name='index')]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 10
0
class RegexReplace(ValueOp):

    input_type = [string, string(name='pattern'), string(name='replacement')]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 11
0
class FindInSet(ValueOp):

    input_type = [string(name='needle'), list_of(string, min_length=1)]
    output_type = rules.shape_like_arg(0, 'int64')
Ejemplo n.º 12
0
class FuzzySearch(BooleanValueOp):

    input_type = [string, string(name='pattern')]
    output_type = rules.shape_like_arg(0, 'boolean')
Ejemplo n.º 13
0
class Translate(ValueOp):

    input_type = [string, string(name='from_str'), string(name='to_str')]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 14
0
class ExtractTimestampField(TimestampUnaryOp):

    output_type = rules.shape_like_arg(0, 'int32')
Ejemplo n.º 15
0
class Repeat(ValueOp):

    input_type = [string, integer(name='times')]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 16
0
class TimestampFromUNIX(ValueOp):

    input_type = [value, rules.string_options(['s', 'ms', 'us'], name='unit')]
    output_type = rules.shape_like_arg(0, 'timestamp')
Ejemplo n.º 17
0
class DecimalPrecision(DecimalUnaryOp):

    output_type = rules.shape_like_arg(0, 'int32')
Ejemplo n.º 18
0
class StrRight(ValueOp):

    input_type = [string, integer(name='nchars')]
    output_type = rules.shape_like_arg(0, 'string')
Ejemplo n.º 19
0
class DecimalScale(UnaryOp):

    output_type = rules.shape_like_arg(0, 'int32')
Ejemplo n.º 20
0
class Sign(UnaryOp):

    # This is the Impala output for both integers and double/float
    output_type = rules.shape_like_arg(0, 'float')
Ejemplo n.º 21
0
class RealUnaryOp(UnaryOp):

    input_type = [number]
    output_type = rules.shape_like_arg(0, 'double')
Ejemplo n.º 22
0
class TimestampDelta(ValueOp):

    input_type = [rules.timestamp, rules.timedelta(name='offset')]
    output_type = rules.shape_like_arg(0, 'timestamp')
Ejemplo n.º 23
0
class Hash(ValueOp):

    input_type = [value, rules.string_options(['fnv'], name='how')]
    output_type = rules.shape_like_arg(0, 'int64')
Ejemplo n.º 24
0
class StringAscii(UnaryOp):

    output_type = rules.shape_like_arg(0, 'int32')
Ejemplo n.º 25
0
class Sign(UnaryOp):

    output_type = rules.shape_like_arg(0, 'int32')