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

Refactorings #58

Merged
merged 6 commits into from
Jul 26, 2023
Merged

Refactorings #58

merged 6 commits into from
Jul 26, 2023

Conversation

JohannesLichtenberger
Copy link
Member

No description provided.

Copy link
Collaborator

@ksclarke ksclarke left a comment

Choose a reason for hiding this comment

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

LGTM... just asked a few questions since I'm new.

@@ -62,7 +62,6 @@ private String toGcmpString(Cmp cmp) {
case gt -> ">";
case le -> "<=";
case lt -> "<";
default -> ">=";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems unlikely, but I wonder if there is any value in having some sort of RuntimeException here in case a future version of Cmp could represent something other than one of the enumerated switch values (in the case where Cmp was updated but this switch wasn't)?

Copy link
Member Author

Choose a reason for hiding this comment

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

As Cmp is an enum we should provide a String getValue() method or something like this and call cmp.getValue() instead.

public TableJoinCursor(Cursor lc, int lSize, int pad) {
this.lc = lc;
this.lSize = lSize;
public TableJoinCursor(Cursor cursor, int size, int pad) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As a newbie who has been reading the code lately, I appreciate these reader-friendly name refactorings :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

It was short for left cursor I assume. However, the hash table should be built on the operator with the lower tuple size, so it can be either the cursor over the right or left operator tuples. I hope I got this right.

@@ -818,6 +818,7 @@ private AST optionDecl() throws TokenizerException {
decl.addChild(stringLiteral);

if ("jn:jsoniq-boolean-and-null-literals".equals(eqnameLiteral.getStringValue())) {
assert stringLiteral != null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious (being a newbie here), do you leave assertions on for the released code? Do you have strong opinions on assert vs. Objects.requireNonNull()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Usually I'd leave them on, but regarding a DBS query engine I'm not sure. But I guess over her assertions are better as they can be disabled.

@JohannesLichtenberger JohannesLichtenberger merged commit f7ade6c into master Jul 26, 2023
2 checks passed
@JohannesLichtenberger JohannesLichtenberger deleted the features branch July 26, 2023 19:10
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.

2 participants