tajo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyunsik <...@git.apache.org>
Subject [GitHub] tajo pull request: TAJO-1670: Refactor client errors and exception...
Date Sun, 19 Jul 2015 23:21:11 GMT
Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/621#discussion_r34963584
  
    --- Diff: tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java
---
    @@ -574,25 +652,26 @@ public final FunctionDesc getFunction(final String signature, FunctionType
funcT
           builder.addParameterTypes(type);
         }
     
    -    FunctionDescProto descProto = null;
    +    FunctionDescResponse response = null;
         try {
    -      CatalogProtocolService.BlockingInterface stub = getStub();
    -      descProto = stub.getFunctionMeta(null, builder.build());
    -    } catch (NoSuchFunctionException e) {
    -      LOG.debug(e.getMessage());
    -    } catch (ServiceException e) {
    -      LOG.error(e.getMessage(), e);
    +      final BlockingInterface stub = getStub();
    +      response = stub.getFunctionMeta(null, builder.build());
    +    } catch (ServiceException se) {
    +      throw new RuntimeException(se);
         }
     
    -    if (descProto == null) {
    -      throw new NoSuchFunctionException(signature, paramTypes);
    +    if (isThisError(response.getState(), ResultCode.UNDEFINED_FUNCTION)) {
    +      throw new UndefinedFunctionException(signature, paramTypes);
    +    } else if (isThisError(response.getState(), ResultCode.AMBIGUOUS_FUNCTION)) {
    --- End diff --
    
    There is a mismatch. DuplicateFunctionException should be AmbiguousFunctionException.
It's my intension. 'Duplicate function exception' will occur only at CREATE FUNCTION.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message