#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This file contains autogenerated external transform(s)
# and should not be edited by hand.
# Refer to gen_xlang_wrappers.py for more info.
"""Cross-language transforms in this module can be imported from the
:py:mod:`apache_beam.io` package."""
# pylint:disable=line-too-long
from apache_beam.transforms.external import BeamJarExpansionService
from apache_beam.transforms.external_transform_provider import ExternalTransform
[docs]class GenerateSequence(ExternalTransform):
"""
Outputs a PCollection of Beam Rows, each containing a single INT64 number
called "value". The count is produced from the given "start" value and either
up to the given "end" or until 2^63 - 1.
To produce an unbounded PCollection, simply do not specify an "end" value.
Unbounded sequences can specify a "rate" for output elements.
In all cases, the sequence of numbers is generated in parallel, so there is no
inherent ordering between the generated values
"""
identifier = "beam:schematransform:org.apache.beam:generate_sequence:v1"
def __init__(self, start, end=None, rate=None, expansion_service=None):
"""
:param start: (numpy.int64)
The minimum number to generate (inclusive).
:param end: (numpy.int64)
The maximum number to generate (exclusive). Will be an unbounded
sequence if left unspecified.
:param rate: (Row(elements=<class 'numpy.int64'>, seconds=typing.Union[numpy.int64, NoneType]))
Specifies the rate to generate a given number of elements per a given
number of seconds. Applicable only to unbounded sequences.
"""
self.default_expansion_service = BeamJarExpansionService(
"sdks:java:io:expansion-service:shadowJar")
super().__init__(
start=start, end=end, rate=rate, expansion_service=expansion_service)