flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hagersaleh <loveallah1...@yahoo.com>
Subject Re: when return value from linkedlist or map and use in filter function display error
Date Tue, 09 Jun 2015 07:16:56 GMT
error dispaly
 non-static variable map cannot be referenced from a static context
map.put("C_MKTSEGMENT", 2);

public Map<String, Integer> map = new HashMap<String, Integer>();
    public static  void main(String[] args) throws Exception {    
        map.put("C_MKTSEGMENT", 2);
        ExecutionEnvironment env =
           customers = customers.filter(new FilterFunction<Customer3>() 
                            public boolean filter(Customer3 c) {
                            Integer index1=map.get("C_MKTSEGMENT");
                            return c.getField(index1).equals("AUTOMOBILE");
         customers.writeAsCsv("/home/hadoop/Desktop/Dataset/out1.csv", "\n",
        env.execute("TPCH Query 3 Example");	

when remove static from main method display error not found main method

View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/when-return-value-from-linkedlist-or-map-and-use-in-filter-function-display-error-tp1528p1555.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

View raw message