Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: Further code cleanups. #597

Merged
merged 5 commits into from
Jan 12, 2018
Merged

Conversation

dguy
Copy link
Contributor

@dguy dguy commented Jan 5, 2018

Remove redundant code, make fields private, remove non thrown exceptions etc

Remove redundant code, make fields private, remove non thrown exceptions etc
Copy link

@bluemonk3y bluemonk3y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dguy
Copy link
Contributor Author

dguy commented Jan 9, 2018

@hjafarpour

@@ -46,7 +46,7 @@

private Expression havingExpression = null;

private Optional<Integer> limitClause = Optional.empty();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you leave Optional? Why not use functional style and avoid dealing with NPE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't be null as users of this class will call getLimitClause() that returns Optional.ofNullable(limitClause) - there is no reason for it to be Optional within the class

.append(" > [ ")
.append(type).append(" ] Schema: ")
.append(SchemaUtil
.getSchemaDefinitionString(schema)).append(".\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to make method invocation SchemaUtil.getSchemaDefinitionString(schema) and object definition on the same line?

} else {
this.schema = SchemaUtil.getSchemaWithNoAlias(schema);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing isInternal? This is required for distinguishing between internal and other topics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is removed as this.schema is never used so there is no point in doing the if(...)

Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm modulo the one spacing issue

@@ -122,13 +122,11 @@ private AggregateNode buildAggregateNode(final Schema inputSchema,
return new AggregateNode(new PlanNodeId("Aggregate"),
sourcePlanNode,
aggregateSchema,
analysis.getSelectExpressions(),
analysis.getGroupByExpressions(),
analysis.getGroupByExpressions(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing

Copy link
Contributor

@hjafarpour hjafarpour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@dguy
Copy link
Contributor Author

dguy commented Jan 11, 2018

retest this please

3 similar comments
@dguy
Copy link
Contributor Author

dguy commented Jan 11, 2018

retest this please

@dguy
Copy link
Contributor Author

dguy commented Jan 11, 2018

retest this please

@dguy
Copy link
Contributor Author

dguy commented Jan 12, 2018

retest this please

@dguy dguy merged commit d443f64 into confluentinc:master Jan 12, 2018
@dguy dguy deleted the further-cleanups branch January 12, 2018 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants