Skip to content

Commit fd2c52d

Browse files
authored
Merge pull request #112 from IBMStreams/develop
check the second output port attributes #101
2 parents c57e2a4 + d88c512 commit fd2c52d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

com.ibm.streamsx.hbase/impl/java/src/com/ibm/streamsx/hbase/HBASEOperator.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,16 @@ public static void runtimeHBaseOperatorChecks(OperatorContextChecker checker) {
201201
if (errorOutputPort.getStreamSchema().getAttribute(0).getType().getMetaType() != Type.MetaType.RSTRING) {
202202
checker.setInvalidContext("The first attribute in the optional error output port must be a rstring", null);
203203
}
204+
205+
// The second attribute of error output port is optional.
206+
if (errorOutputPort.getStreamSchema().getAttributeCount() > 1){
204207
// The second attribute of optional error output port must be a Tuple.
205-
if (errorOutputPort.getStreamSchema().getAttribute(1) !=null){
206-
if (errorOutputPort.getStreamSchema().getAttribute(1).getType().getMetaType() != Type.MetaType.TUPLE) {
207-
checker.setInvalidContext("The second attribute in the optional error output port must be a TUPLE", null);
208+
if (errorOutputPort.getStreamSchema().getAttribute(1) !=null){
209+
if (errorOutputPort.getStreamSchema().getAttribute(1).getType().getMetaType() != Type.MetaType.TUPLE) {
210+
checker.setInvalidContext("The second attribute in the optional error output port must be a TUPLE", null);
211+
}
212+
208213
}
209-
210214
}
211215

212216
}

0 commit comments

Comments
 (0)