def test_simple_pk(self):
        table = 'join_rdd_test_simple_pk'

        self.session.execute('''
            CREATE TABLE IF NOT EXISTS ''' + table + ''' (
                key text primary key, value text
            )
        ''')
        self.session.execute(table % 'TRUNCATE %s')

        rows = {
           str(c) : str(i) for i, c in
           enumerate(string.ascii_lowercase)
        }

        for k, v in rows.items():
            self.session.execute(
                'INSERT INTO ' + table + ' (key, value) values (%s, %s)', (k, v)
            )

        rdd = self.sc.parallelize(rows.items())
        self.assertEqual(dict(rdd.collect()), rows)

        tbl = rdd.joinWithCassandraTable(self.keyspace, table)
        joined = tbl.on('key').select('key', 'value').cache()
        self.assertEqual(dict(joined.keys().collect()), dict(joined.values().collect()))
        for (k, v) in joined.collect():
            self.assertEqual(k, v)
dataset/ETHPy150Open TargetHolding/pyspark-cassandra/python/pyspark_cassandra/tests.py/JoinRDDTest.test_simple_pk/swapped operands of `%`