allthenutsandbolts
allthenutsandbolts

Reputation: 1523

Spark Connector - unable to get data when using List of Tuples

I have the following definition of my JavaBean

public class LiveResultsFrmCassandra implements Serializable{


    UUID id;

    String userdn;
    String queryid;

    private List<Tuple4<String, String, String, String>> docList = new ArrayList();


    public LiveResultsFrmCassandra() {
    }

    public UUID getId() {
        return id;
    }

    public String getUserdn() {
        return userdn;
    }

    public String getQueryid() {
        return queryid;
    }


    public void setId(UUID id) {
        this.id = id;
    }

    public void setUserdn(String userdn) {
        this.userdn = userdn;
    }

    public void setQueryid(String queryid) {
        this.queryid = queryid;
    }

    public List<Tuple4<String, String, String, String>> getDocList() {
        return docList;
    }

    public void setDocList(List<Tuple4<String, String, String, String>> docList) {
        this.docList = docList;
    }
}

I have the following code to read data using Spark Connector,

JavaRDD<LiveResultsFrmCassandra> resultsRDD = javaFunctions(sparkContext).cassandraTable(mf.getConfig().getDatabaseName(), LIVERESULTS, mapRowTo(LiveResultsFrmCassandra.class));

My table Definition is a follows

CREATE TABLE IF NOT EXISTS LiveResults (
 id uuid PRIMARY KEY,
 doclist list<frozen<tuple<text, text, text, text>>>,
 queryid text,
 userdn text );

I see data is coming in other Fields but I'm not getting the data for docList. Has anybody seen the same behavior ?

Upvotes: 0

Views: 115

Answers (1)

abaghel
abaghel

Reputation: 15297

Use lowercase for docklist and getter and setter like below.

List<Tuple4<String, String, String, String>> doclist =  new ArrayList();

public List<Tuple4<String, String, String, String>> getDoclist() {
    return doclist;
}

public void setDoclist(List<Tuple4<String, String, String, String>> doclist) {
    this.doclist = doclist;
}

Upvotes: 2

Related Questions