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

[v1] Add javadoc for AST; refactor of ExprVarRef scope #1694

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alancai98
Copy link
Member

@alancai98 alancai98 commented Jan 3, 2025

Relevant Issues

Description

  • Adds javadocs for hand-written AST classes
  • Removes the lombok getters in favor of hand-written getters since the lombok-annotated @Getters were not included in the javadoc

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alancai98 alancai98 self-assigned this Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

CROSS-ENGINE-REPORT ❌

BASE (LEGACY-V0.14.8) TARGET (EVAL-549694F) +/-
% Passing 89.67% 94.56% 4.88% ✅
Passing 5287 5575 288 ✅
Failing 609 47 -562 ✅
Ignored 0 274 274 🔶
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: v0.14.8
  • Base Engine: LEGACY
  • Target Commit: 549694f
  • Target Engine: EVAL

Result Details

  • ❌ REGRESSION DETECTED. See Now Failing/Ignored Tests. ❌
  • Passing in both: 2644
  • Failing in both: 17
  • Ignored in both: 0
  • PASSING in BASE but now FAILING in TARGET: 2
  • PASSING in BASE but now IGNORED in TARGET: 108
  • FAILING in BASE but now PASSING in TARGET: 180
  • IGNORED in BASE but now PASSING in TARGET: 0

Now FAILING Tests ❌

The following 2 test(s) were previously PASSING in BASE but are now FAILING in TARGET:

Click here to see
  1. inPredicateWithTableConstructor, compileOption: PERMISSIVE
  2. notInPredicateWithTableConstructor, compileOption: PERMISSIVE

Now IGNORED Tests ❌

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Now Passing Tests

180 test(s) were previously failing in BASE (LEGACY-V0.14.8) but now pass in TARGET (EVAL-549694F). Before merging, confirm they are intended to pass.

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

CROSS-COMMIT-REPORT ✅

BASE (EVAL-71E9EE3) TARGET (EVAL-549694F) +/-
% Passing 94.56% 94.56% 0.00% ✅
Passing 5575 5575 0 ✅
Failing 47 47 0 ✅
Ignored 274 274 0 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: 71e9ee3
  • Base Engine: EVAL
  • Target Commit: 549694f
  • Target Engine: EVAL

Result Details

  • Passing in both: 5575
  • Failing in both: 47
  • Ignored in both: 274
  • PASSING in BASE but now FAILING in TARGET: 0
  • PASSING in BASE but now IGNORED in TARGET: 0
  • FAILING in BASE but now PASSING in TARGET: 0
  • IGNORED in BASE but now PASSING in TARGET: 0

@@ -29,22 +31,17 @@ public final class DataType extends AstEnum {
@EqualsAndHashCode(callSuper = false)
public static class StructField extends AstNode {
@NotNull
@Getter
Copy link
Member Author

Choose a reason for hiding this comment

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

(self-review) potential issue w/ the @Getter (and also @Builder) annotation is that they are not included in the generated Javadoc. So in this PR, I ended up using delombok to add the hand-written getters. Some of the getters did have some useful javadoc (especially related to boolean parameters), so including it in the javadoc can be helpful for consumers.

We could apply the same in the future to @Builders if there's a need.

@NotNull
@Getter
private final Scope scope;
private final boolean qualified;
Copy link
Member Author

Choose a reason for hiding this comment

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

(self-review) simplification of var ref modeling comes from this prior PR comment -- #1688 (comment). No need to have a separate enum to model the @T vs T var ref.

@alancai98 alancai98 marked this pull request as ready for review January 4, 2025 00:44
@alancai98 alancai98 requested a review from johnedquinn January 4, 2025 00:44
@@ -74,6 +71,30 @@ public List<AstNode> getChildren() {
public <R, C> R accept(@NotNull AstVisitor<R, C> visitor, C ctx) {
return visitor.visitStructField(this, ctx);
}

@NotNull
Copy link
Member Author

Choose a reason for hiding this comment

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

(self-review) left out the javadoc for most of the

  • getters
  • static enum constructor methods
  • default constructors

imo, those functions and constructor arguments are pretty self-explanatory.

RCHowell
RCHowell previously approved these changes Jan 6, 2025
Copy link
Member

@RCHowell RCHowell left a comment

Choose a reason for hiding this comment

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

Docs look good enough, thanks for doing this big effort.

@@ -3,11 +3,19 @@
import org.jetbrains.annotations.NotNull;

/**
* TODO docs, equals, hashcode
* Base abstract class representing enums in the AST.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Base abstract class representing enums in the AST.
* Abstract base class representing enums in the AST.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack, I'll change in a few other places as well.

partiql-ast/src/main/java/org/partiql/ast/AstNode.java Outdated Show resolved Hide resolved
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