Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/2094#discussion_r84767676
--- Diff:
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
---
@@ -203,7 +206,34 @@ public void getFlatFields(String fieldExpression, int
offset, List<FlatFieldDesc
TypeInformation<X> typed = (TypeInformation<X>) this.types[pos];
return typed;
}
-
+
+ @Override
+ @PublicEvolving
+ public <F> FieldAccessor<T, F> getFieldAccessor(int pos,
ExecutionConfig config) {
+ return new FieldAccessor.SimpleTupleFieldAccessor<T, F>(pos,
this);
+ }
+
+ @Override
+ @PublicEvolving
+ public <F> FieldAccessor<T, F> getFieldAccessor(String fieldExpression,
ExecutionConfig config) {
+ FieldAccessor.FieldExpression decomp =
FieldAccessor.decomposeFieldExpression(fieldExpression);
+ int fieldPos = this.getFieldIndex(decomp.head);
+ if (fieldPos == -1) {
+ try {
+ fieldPos = Integer.parseInt(decomp.head);
+ } catch (NumberFormatException ex) {
+ throw new InvalidFieldReferenceException("Tried
to select field \"" + decomp.head
--- End diff --
Exception does not tell user that only integer values are allowed.
---
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.
---