impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Jacobs (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4795: Allow fetching function obj from catalog using signature
Date Mon, 24 Jul 2017 21:27:24 GMT
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-4795: Allow fetching function obj from catalog using signature

Patch Set 1:


Adding to Bharath's comments; please address those too.
File fe/src/main/java/org/apache/impala/catalog/

PS1, Line 463: TFunction tfn = objectDesc.getFn();
             :         Function fn = null;
             :         if (tfn.isSetScalar_fn() || tfn.isSetAggregate_fn()) {
             :           Function desc = Function.fromThrift(tfn);
             :           fn = getFunction(desc, Function.CompareMode.IS_INDISTINGUISHABLE);
             :         } else if (tfn.isSetSignature()) {
             :           Db db = getDb(tfn.getName().getDb_name());
             :           fn = (db == null) ? null : db.getFunction(tfn.getSignature());
             :         }
> nit: How about moving this to a new method, getFunction(TFunction fn, mode)
Pulling into a separate fn with a clear interface in the javadoc makes sense. Not sure you
need to expose 'mode' though.
File fe/src/main/java/org/apache/impala/catalog/

Line 360:       throw new IllegalStateException("Expected function type to be either UDA or
This seems like a reasonable thing to do later, but I'm not sure if this will break anything
else. It looks like there are a few callers to fromThrift(), and at least some of them make
me nervous about changing this behavior:

e.g. CatalogServiceCatalog.loadFunctionsFromDbParams(). That loads fns from a serialized copy
that is stored in a table property. Unfortunately I don't think this is well tested. Not sure
what kinds of serialized TFunctions exist in existing HMS instances.

For now, just leave a TODO.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I2cfad0213a79d39b77ad9aff701a93f93be4bf7f
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Bikramjeet Vig <>
Gerrit-Reviewer: Bharath Vissapragada <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-HasComments: Yes

View raw message