コード例 #1
0
from pysparkling import Context

my_rdd = Context().textFile("tests/*.py")
print(
    "In tests/*.py: all lines={0}, with import={1}".format(
        my_rdd.count(), my_rdd.filter(lambda l: l.startswith("import ")).count()
    )
)
コード例 #2
0
ファイル: readme_example.py プロジェクト: giserh/pysparkling
from pysparkling import Context

my_rdd = Context().textFile('tests/*.py')
print('In tests/*.py: all lines={0}, with import={1}'.format(
    my_rdd.count(),
    my_rdd.filter(lambda l: l.startswith('import ')).count()))
コード例 #3
0
from pysparkling import Context

my_rdd = Context().textFile('tests/*.py')

unfiltered_count = my_rdd.count()
filtered_count = my_rdd.filter(lambda l: l.startswith("import ")).count()
print(
    f'In tests/*.py: all lines={unfiltered_count}, with import={filtered_count}'
)
コード例 #4
0
from __future__ import print_function

from pysparkling import Context

my_rdd = Context().textFile('tests/*.py')
print('In tests/*.py: all lines={0}, with import={1}'.format(
    my_rdd.count(),
    my_rdd.filter(lambda l: l.startswith('import ')).count(),
))