Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/426#discussion_r26993897
--- Diff:
flink-scala/src/main/scala/org/apache/flink/api/scala/ExecutionEnvironment.scala
---
@@ -247,16 +252,27 @@ class ExecutionEnvironment(javaEnv: JavaEnv) {
inputFormat.enableQuotedStringParsing(quoteCharacter);
}
- val classes: Array[Class[_]] = new Array[Class[_]](typeInfo.getArity)
+ val classesBuf: ArrayBuffer[Class[_]] = new ArrayBuffer[Class[_]]
for (i <- 0 until typeInfo.getArity) {
- classes(i) = typeInfo.getTypeAt(i).getTypeClass
+ typeInfo match {
+ case info: TupleTypeInfoBase[T] => classesBuf +=
info.getTypeAt(i).getTypeClass()
+ case info: PojoTypeInfo[T] =>
+ if (includedFields == null || includedFields.indexOf(i) != -1) {
--- End diff --
Just add all POJO fields without checking against includedFields.
IncludedFields refer to the fields of the CSV file not to the fields of the
POJO.
The later check ensures that the number of read fields and the number of
POJO/Tuple fields is equal.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---