Till Westmann has posted comments on this change. Change subject: Cast Record Before Insert for Open Indexes ......................................................................
Patch Set 3: (7 comments) Mostly comments on exception handling/error codes. https://asterix-gerrit.ics.uci.edu/#/c/997/3/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java File asterixdb/asterix-common/src/main/java/org/apache/asterix/common/dataflow/AsterixLSMInsertDeleteOperatorNodePushable.java: Line 134: throw new HyracksDataException( Probably we should not wrap this exception as the ErrorCode.TUPLE is not appropriate here? Having a different operation here sounds more like a system error than an error in the data (which I believe is the case for TUPLE). Is that right? https://asterix-gerrit.ics.uci.edu/#/c/997/3/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java File asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java: Line 251: // check unmatched fields in the input type Here we should use the message formatting mechanism HyracksDataException and pass the types a error objects: throw new HyracksDataException( HyracksDataException.NONE, ErrorCode.CAST, "Field type %1$s cannot be promoted to type %2$s", inputTypeTag, requiredTypeTag); https://asterix-gerrit.ics.uci.edu/#/c/997/3/hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/AssignRuntimeFactory.java File hyracks-fullstack/algebricks/algebricks-runtime/src/main/java/org/apache/hyracks/algebricks/runtime/operators/std/AssignRuntimeFactory.java: Line 101: private int t = 0; What is 't'? Could we have a more explicit name? Line 173: try { Can we just remove this try-catch and ... Line 183: } catch (HyracksDataException hde) { ... catch (HyracksDataException|AlgebricksException e) { instead? https://asterix-gerrit.ics.uci.edu/#/c/997/3/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java File hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java: Line 30: A few comments on the error codes: 1) CAST is only used in AsterixDB. So we should create a new error code namespace for AsterixDB and a class for ErrorCodes in AsterixDB. 2) I think that the error codes should be more descriptive so that readers of the code can relate to what's happening. E.g. ERROR_PROCESSING_TUPLE instead of TUPLE or CANNOT_PROMOTE_VALUE or CANNOT_CAST_VALUE instead of CAST. 3) I would also remove unused codes. Does this make sense? https://asterix-gerrit.ics.uci.edu/#/c/997/3/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ExceptionUtils.java File hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/utils/ExceptionUtils.java: Line 60: newExceptions.add(new HyracksDataException(e, nodeId)); I guess this could use a code like "FAILURE_ON_NODE" to explain the nodeId? -- To view, visit https://asterix-gerrit.ics.uci.edu/997 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0eef5813ddbfe1b9c518cd7f92d37c95e8486914 Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com> Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Gerrit-Reviewer: Till Westmann <ti...@apache.org> Gerrit-Reviewer: Yingyi Bu <buyin...@gmail.com> Gerrit-Reviewer: abdullah alamoudi <bamou...@gmail.com> Gerrit-HasComments: Yes