Example #1
0
class RPad(ValueOp):

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

    input_type = [
        string,
        integer(name='start'),
        integer(name='length', optional=True)
    ]
    output_type = rules.shape_like_arg(0, 'string')
Example #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')
Example #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')
Example #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')
Example #6
0
class StringLength(UnaryOp):
    """
    Compute length of strings

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

    output_type = rules.shape_like_arg(0, 'int32')
Example #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')
Example #8
0
class StringUnaryOp(UnaryOp):

    input_type = [string]
    output_type = rules.shape_like_arg(0, 'string')
Example #9
0
class RegexExtract(ValueOp):

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

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

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

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

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

    output_type = rules.shape_like_arg(0, 'int32')
Example #15
0
class Repeat(ValueOp):

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

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

    output_type = rules.shape_like_arg(0, 'int32')
Example #18
0
class StrRight(ValueOp):

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

    output_type = rules.shape_like_arg(0, 'int32')
Example #20
0
class Sign(UnaryOp):

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

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

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

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

    output_type = rules.shape_like_arg(0, 'int32')
Example #25
0
class Sign(UnaryOp):

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