[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-12 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14358863#comment-14358863
 ] 

Adnan Khan commented on FLINK-1388:
---

Also - Why should pass the name of all the fields that should be written out? 
If I have a reference to the POJO itself, I can always just grab the 
{{Fields[]}} using Java's reflection api. I feel I've missed something.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-12 Thread Fabian Hueske (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14358878#comment-14358878
 ] 

Fabian Hueske commented on FLINK-1388:
--

Sure you can do that. I thought it might be a good idea to give the option to 
select the fields to write out and their order.
But we of course start with writing all fields.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357170#comment-14357170
 ] 

Robert Metzger commented on FLINK-1388:
---

Hi,
yes, Tuple types are subclassed. Flink provides predefined Tuple1- Tuple25.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Fabian Hueske (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357234#comment-14357234
 ] 

Fabian Hueske commented on FLINK-1388:
--

Watch out, PojoTypeInformation is not serializable due to the non-serializable 
``java.lang.reflect.Field``.
You should rather pass the Pojo class name and the name of all fields that 
should be written out.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Fabian Hueske (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357577#comment-14357577
 ] 

Fabian Hueske commented on FLINK-1388:
--

That is right, but the OutputFormat itself is also serialized and shipped to 
the TaskManager in the cluster where it is executed.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357418#comment-14357418
 ] 

Adnan Khan commented on FLINK-1388:
---

so i understand - why does it matter if TypeInformation is serializable or not? 
aren't we just using it access the fields we're going to write out?

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357717#comment-14357717
 ] 

Adnan Khan commented on FLINK-1388:
---

Does that make any references to TypeInformation in OutputFormat unuseable once 
it's shipped to TaskManager on the cluster? Or does it not guarantee anything 
about to non-serializable class members like java.lang.reflect.Field.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-11 Thread Fabian Hueske (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14357866#comment-14357866
 ] 

Fabian Hueske commented on FLINK-1388:
--

It just won't work and throw an exception which kills the job. You cannot 
serialize an object that has a non-serializable member variable (at least not 
with the standard Java serialization which Flink is using to ship function and 
input/output format object).

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-03-09 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14353460#comment-14353460
 ] 

Robert Metzger commented on FLINK-1388:
---

Thank you for updating your changes.

There is the following problem with the change: You've added another {{public 
void writeRecord(T element, Object pojo) throws IOException}} method with a 
different signature. Inside the method, you're casting {{T element}} to 
TypeInformation. But at runtime the system will not pass TypeInformations in 
there, it will pass the actual POJO objects.
So this cast will fail.

You have to pass the TypeInformation into the CsvOutputFormat when creating it 
in the {{DataSet}}. The TypeInformation is the same for all records.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-18 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14325971#comment-14325971
 ] 

Robert Metzger commented on FLINK-1388:
---

Yes, adding additional tests is always good.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-17 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14325020#comment-14325020
 ] 

Adnan Khan commented on FLINK-1388:
---

Hey thanks. 

* What exactly do you mean by integration with {{DataSet.internalWriteAsCsv}}?
* When you say TypeExtraction on every tuple - Do you mean the specific calls 
to {{TypeExtractor.createTypeInfo()}} on every tuple?
* That makes sense. I'm going to go with Timo's suggestion and try to modify 
{{org.apache.flink.api.java.io.CsvOutputFormat}} which extends 
{{FileOutputFormat}}

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-15 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321961#comment-14321961
 ] 

Robert Metzger commented on FLINK-1388:
---

Cool.
Some feedback:
- I think an integration with {{DataSet.internalWriteAsCsv()}} would be nice.
- From there, you can also pass the TypeInformation into the method (right now, 
the code is doing the TypeExtraction on every tuple. That won't work on large 
data sets)
- I think it would be much easier for you to extend from the 
{{FileOutputFormat}}. It will do all the file-related stuff for you (your code 
does not allow to write files to HDFS).



 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-15 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321756#comment-14321756
 ] 

Adnan Khan commented on FLINK-1388:
---

Heya,

Can I get some feedback on the CSV writer code in my working branch? Here's the 
latest [commit| 
https://github.com/khnd/flink/commit/4934f1843cdae1080afb24e8d22a405c70faf13d].

Thanks.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-14 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321635#comment-14321635
 ] 

Robert Metzger commented on FLINK-1388:
---

Yes, for private fields you need to make them accessible first. Currently, 
there is only code in Flink which is accessing these fields as keys. And 
somewhere we make the fields accessible prior to using them.
You can safely make them accessible. I would recommend to do that inside the 
CSV writer code to make sure it happens properly on all machines.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-14 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321633#comment-14321633
 ] 

Adnan Khan commented on FLINK-1388:
---

Hey Timo,

So the rules for defining a POJO according to 
[this|https://github.com/apache/flink/blob/master/docs/internal_types_serialization.md]
 include this part {quote} All fields in the class (and all superclasses) are 
either public or or have a public getter and a setter method that follows the 
Java beans naming conventions for getters and setters. {quote}

So that means that it could have private fields. I was thinking we should add 
{{field.setAccessible(true)}} in the implementation for {{PojoField}}. 
Otherwise something like {{pFieldValue = pField.field.get(myPojo)}} does not 
seem to work.

I ran into while I was testing the CSV writer with POJOs with private fields 
but public getter/setters.


 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-14 Thread Robert Metzger (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321645#comment-14321645
 ] 

Robert Metzger commented on FLINK-1388:
---

How about {{org.apache.flink.api.java.functions}} ?

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-14 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321642#comment-14321642
 ] 

Adnan Khan commented on FLINK-1388:
---

Okay thanks, that sounds good.

Also - Where should I put the csv writer code? Right now I have it in 
{{org.apache.flink.api.java.typeutils.runtime}}

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-08 Thread Timo Walther (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311342#comment-14311342
 ] 

Timo Walther commented on FLINK-1388:
-

Hey Adnan,

for testing purposes you can create a PojoTypeInfo instance by using 
TypeExtractor.createTypeInfo(MyPojo.class). The PojoTypeInfo will later be 
supplied by the preceding operator.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-08 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14311329#comment-14311329
 ] 

Adnan Khan commented on FLINK-1388:
---

Hey Fabian, 

I've been digging through those two classes you mentioned, but I'm still not 
clear on how to use the {{PojoTypeInfo}}. So given a custom POJO, how to create 
a {{PojoTypeInfo}} instance. Specifically because it takes in a 
{{ListPojoField}} as a constructor parameter as seen here {{public 
PojoTypeInfo(ClassT typeClass, ListPojoField fields)}}

However looking at the example output in the ticket description above, I can 
generate a CSV string using Java's reflect library. I feel I've missed 
something.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-06 Thread Fabian Hueske (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14308934#comment-14308934
 ] 

Fabian Hueske commented on FLINK-1388:
--

Hi,

the PojoTypeInfo contains all information you need. Get the PojoFields like 

{code}
int numFields = pType.getArity();
for(int i=0;inumFields;i++) {
  PojoField pField = pType.getPojoFieldAt(i);
}
{code}

The PojoField contains the reflection field {{pField.field}} which can be used 
to extract the field like {{pFieldValue = pField.field.get(myPojo)}}.
Have a look at {{PojoSerializer.serialize()}} and {{PojoTypeInfo}}.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Assignee: Adnan Khan
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-02-04 Thread Adnan Khan (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305996#comment-14305996
 ] 

Adnan Khan commented on FLINK-1388:
---

I'll work on this one.

 POJO support for writeAsCsv
 ---

 Key: FLINK-1388
 URL: https://issues.apache.org/jira/browse/FLINK-1388
 Project: Flink
  Issue Type: New Feature
  Components: Java API
Reporter: Timo Walther
Priority: Minor

 It would be great if one could simply write out POJOs in CSV format.
 {code}
 public class MyPojo {
String a;
int b;
 }
 {code}
 to:
 {code}
 # CSV file of org.apache.flink.MyPojo: String a, int b
 Hello World, 42
 Hello World 2, 47
 ...
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1388) POJO support for writeAsCsv

2015-01-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14278333#comment-14278333
 ] 

ASF GitHub Bot commented on FLINK-1388:
---

GitHub user msdevanms opened a pull request:

https://github.com/apache/flink/pull/312

https://issues.apache.org/jira/browse/FLINK-1388

https://issues.apache.org/jira/browse/FLINK-1388

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/flink release-0.8

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/312.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #312


commit a33ad5d8303295e57f0e6a8df3c071f010963029
Author: mbalassi mbala...@apache.org
Date:   2014-12-16T11:48:09Z

[streaming] DataStream print functionality update

PrintSinkFunction now explicitly states threads in output
Added printToErr functionality

commit e34aca7545f4900725b470ff1ab2db4b48c2275f
Author: mbalassi mbala...@apache.org
Date:   2014-12-16T20:00:31Z

[streaming] [examples] Refactor and packaging for windowing examples

The current examples show-case the API, more meaningful examples are coming 
for the 0.9 release.

commit c8e306b6567a4b615c54e8d8f88116ff6f1a0e38
Author: Gyula Fora gyf...@apache.org
Date:   2014-12-16T21:49:58Z

[streaming] Updated deprecated iterative functionality and docs

commit 1ac9651abff2760a2a66c6cce0e3aa2e1bf5d1dd
Author: twalthr i...@twalthr.com
Date:   2014-12-10T21:02:07Z

Fix invalid type hierarchy creation by Pojo logic

commit a835e5dfb97624f3132761c7933aaffb03b0d06f
Author: Robert Metzger rmetz...@apache.org
Date:   2014-12-16T10:30:52Z

[FLINK-610] Replace Avro by Kryo as the GenericType serializer

The performance of data-intensive jobs using Kryo is probably going to be 
slow.

Set correct classloader

try to use Kryo.copy() with fallback to serialization copy

commit 7ef04c625768515c874f3b015cf30f6631c4dade
Author: Robert Metzger metzg...@web.de
Date:   2014-12-16T21:00:50Z

[FLINK-1333] Fixed getter/setter recognition for POJOs

This closes #271

commit 02bad15318da525f6db938a41cd10c7203156314
Author: mbalassi mbala...@apache.org
Date:   2014-12-17T15:46:01Z

[FLINK-1325] [streaming] Added clousure cleaning to streaming

This closes #273

commit 6f481ce785b9d4a9824b9d7c82e18342bbeaf897
Author: Till Rohrmann trohrm...@apache.org
Date:   2014-12-18T10:37:23Z

Fixes race condition in ExecutionGraph which allowed a job to go into the 
finished state without all job vertices having properly processed the 
finalizeOnMaster method.

commit 15fb1da9907cc549ddb94f191fba11618f546854
Author: Stephan Ewen se...@apache.org
Date:   2014-12-18T14:28:54Z

[FLINK-1336] [core] Fix bug in StringValue binary copy method

commit 88f38e49202354926cb4ec36390cbe34bad247a3
Author: Gyula Fora gyf...@apache.org
Date:   2014-12-17T22:34:26Z

[streaming] StreamInvokable rework for simpler logic and easier use

commit 2ac49856ac8a3aa42912b1e74a7109792c5b93aa
Author: mbalassi mbala...@apache.org
Date:   2014-12-17T23:28:07Z

[dist] Updated the assembly of the examples subdirectory

Excluded the scala example jars
Excluded the example source code subdirectories

This closes #274

commit 446cc1253554f924664d7fe753f3cee46ee87c13
Author: Gyula Fora gyf...@apache.org
Date:   2014-12-18T13:52:15Z

[streaming] Added immutability for window and filter operators

commit cadc9cce0bbfa2615ed746a6b0372f21e042a945
Author: Jonas Traub (powibol) j...@s-traub.com
Date:   2014-12-18T15:11:16Z

[streaming] Make windowed data stream aware of time based trigger/eviction 
in tumbling window situations.

[streaming] Changed TimeEvictionPolicy to keep timestamps in the buffer 
instead of data-items

commit 9555c827f8b354722f6865d531f3fccd400c0015
Author: mbalassi mbala...@apache.org
Date:   2014-12-19T22:34:02Z

[FLINK-1338] Updates necessary due to Apache graduation

Removed Disclaimer file
Eliminated unnecessary incubating substrings
Bumped version to 0.8-SNAPSHOT

commit 6b3c3a1780b1270226a76f6a81a9ad2029578a7a
Author: mbalassi mbala...@apache.org
Date:   2014-12-26T17:02:55Z

[FLINK-1225] Fix for quickstart packaging

This closes #279

commit 2467f36c80830e83b43271c89cf1ec827882b424
Author: mbalassi mbala...@apache.org
Date:   2014-12-26T17:06:51Z

[streaming] Temporal fix for streaming source parallelism

commit b2271bd9eb3adc1770f40d452ed7fb69614ea649
Author: Gyula Fora gyf...@apache.org
Date:   2015-01-02T17:33:46Z

[streaming] Time trigger preNotify fix

commit 6b1fd156a774a8292dd2e9227d611dcca5b9c526
Author: Gyula Fora gyf...@apache.org
Date:   2014-12-11T14:22:03Z