Will-Lo commented on code in PR #3533:
URL: https://github.com/apache/gobblin/pull/3533#discussion_r940503943


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpecSearchObject.java:
##########
@@ -136,11 +147,11 @@ public String augmentBaseGetStatement(String 
baseStatement)
       }
     }
 
-    if (conditions.size() == 0) {

Review Comment:
   Wouldn't an easier check be to check if limitAndOffset.size() == 0 ? I don't 
think you need an explicit boolean to determine when to get all in that case.



##########
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigsV2Resource.java:
##########
@@ -125,9 +132,18 @@ public List<FlowConfig> getFilteredFlows(@Context 
PagingContext context,
       @Optional @QueryParam("isRunImmediately") Boolean isRunImmediately,
       @Optional @QueryParam("owningGroup") String owningGroup,
       @Optional @QueryParam("propertyFilter") String propertyFilter) {
-    FlowSpecSearchObject flowSpecSearchObject = new FlowSpecSearchObject(null, 
flowGroup, flowName,
-        templateUri, userToProxy, sourceIdentifier, destinationIdentifier, 
schedule, null,

Review Comment:
   Good to add a comment to specify what this check is doing. Also define the 
behavior if the user specifies one and not the other



##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/MysqlSpecStore.java:
##########
@@ -138,7 +139,9 @@ protected SqlStatements createSqlStatements() {
   /** Support search, unlike base class (presumably via a {@link 
org.apache.gobblin.runtime.api.FlowSpecSearchObject}). */
   @Override
   public Collection<Spec> getSpecsImpl(SpecSearchObject specSearchObject) 
throws IOException {
-    return 
withPreparedStatement(specSearchObject.augmentBaseGetStatement(this.sqlStatements.getStatementBase),
 statement -> {

Review Comment:
   Is this necessary if we just trust that null (-1) start and count values 
wouldn't add themselves to the statement, so we wouldn't have to do this check 
since it would just be a sql statement without the OFFSET and LIMIT?



##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpecSearchObject.java:
##########
@@ -191,5 +202,12 @@ public void completePreparedStatement(PreparedStatement 
statement)
     if (this.getOwningGroup() != null) {
       statement.setString(++i, this.getOwningGroup());
     }
+
+    if (this.getCount() != 0) {

Review Comment:
   If you define the null value here to be -1 which I see above, your boolean 
check should represent that value. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to