コード例 #1
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')
コード例 #2
0
    class MyOp(ops.Node):

        input_type = [
            rules.string_options(options, case_sensitive=False, name='value')
        ]

        def __init__(self, value):
            super(MyOp, self).__init__([value])

        def output_type(self):
            return MyExpr
コード例 #3
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')
コード例 #4
0
class Hash(ValueOp):

    input_type = [value, rules.string_options(['fnv'], name='how')]
    output_type = rules.shape_like_arg(0, 'int64')
コード例 #5
0
class TimestampFromUNIX(ValueOp):

    input_type = [value, rules.string_options(['s', 'ms', 'us'], name='unit')]
    output_type = rules.shape_like_arg(0, 'timestamp')