def joinWithCassandraTable(dstream, keyspace, table, selected_columns=None, join_columns=None):

    ssc = dstream._ssc
    ctx = ssc._sc
    gw = ctx._gateway

    selected_columns = as_java_array(gw, "String", selected_columns) if selected_columns else None
    join_columns = as_java_array(gw, "String", join_columns) if join_columns else None

    h = helper(ctx)
    dstream = h.joinWithCassandraTable(dstream._jdstream, keyspace, table, selected_columns,
                                       join_columns)
    dstream = h.pickleRows(dstream)
    dstream = h.javaDStream(dstream)

    return DStream(dstream, ssc, AutoBatchedSerializer(PickleSerializer()))


# Monkey patch the default python DStream so that data in it can be stored to and joined with
# Cassandra tables
Returns a descriptive name of the service
dataset/ETHPy150Open TargetHolding/pyspark-cassandra/python/pyspark_cassandra/streaming.py/joinWithCassandraTable--crossover with--dataset/ETHPy150Open cloudera/impyla/impala/_thrift_gen/fb303/FacebookService.py/Iface.getName