-
Notifications
You must be signed in to change notification settings - Fork 103
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
formatting explain with stable aliases #3015
Conversation
Result of fdb-record-layer-pr on Linux CentOS 7
|
0bb6fde
to
45974e7
Compare
Result of fdb-record-layer-pr on Linux CentOS 7
|
Result of fdb-record-layer-pr on Linux CentOS 7
|
45974e7
to
5f1e42f
Compare
Result of fdb-record-layer-pr on Linux CentOS 7
|
Result of fdb-record-layer-pr on Linux CentOS 7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only looked at the new formatter framework classes so far, but I figured you'd want feedback on that first, so I'm submitting what I have now
...ayer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainTokens.java
Outdated
Show resolved
Hide resolved
...ayer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainTokens.java
Outdated
Show resolved
Hide resolved
...ayer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainTokens.java
Outdated
Show resolved
Hide resolved
...ayer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainTokens.java
Outdated
Show resolved
Hide resolved
...ayer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainTokens.java
Outdated
Show resolved
Hide resolved
logger.debug(KeyValueLogMessage.of("explain of plan", | ||
logger.debug(KeyValueLogMessage.of("GML explain of plan", | ||
"explain", PlannerGraphProperty.explain(singleRoot))); | ||
logger.debug(KeyValueLogMessage.of("string explain of plan", | ||
"explain", ExplainPlanVisitor.toStringForDebugging((RecordQueryPlan)singleRoot))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be consolidated into a single log message with both the GML and the string explain? Arguably, this should just have the string explain, as I think that will be more useful for humans reading through the logs, if we even want to rely on this log line at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not enough testing for GML that's why it's there in the first place. Maybe I should open a ticket for that. For now I think this is safer and will not ever be triggered other than in local debugging sessions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, got it. But would it make sense to collapse both calls to a single log message, like:
logger.debug(KeyValueLogMessage.of("explain of plan",
"explain_gml", PlannerGraphProperty.explain(singleRoot),
"explain_string", ExplainPlanVisitor.toStringForDebugging((RecordQueryPlan)singleRoot)));
I think you get the same amount of coverage, but only one log message. Which is something we sort of care about, even for debug logs
...layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainLevel.java
Outdated
Show resolved
Hide resolved
...layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/ExplainLevel.java
Outdated
Show resolved
Hide resolved
...in/java/com/apple/foundationdb/record/query/plan/cascades/ExplainSelfContainedSymbolMap.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/apple/foundationdb/record/query/plan/cascades/PrettyExplainFormatter.java
Outdated
Show resolved
Hide resolved
Result of fdb-record-layer-pr on Linux CentOS 7
|
Result of fdb-record-layer-pr on Linux CentOS 7
|
...-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/explain/ExplainLevel.java
Show resolved
Hide resolved
...er-core/src/main/java/com/apple/foundationdb/record/query/plan/explain/ExplainSymbolMap.java
Outdated
Show resolved
Hide resolved
...er-core/src/main/java/com/apple/foundationdb/record/query/plan/explain/ExplainSymbolMap.java
Outdated
Show resolved
Hide resolved
...ain/java/com/apple/foundationdb/record/query/plan/explain/ExplainSelfContainedSymbolMap.java
Show resolved
Hide resolved
...ain/java/com/apple/foundationdb/record/query/plan/explain/ExplainSelfContainedSymbolMap.java
Show resolved
Hide resolved
...rd-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/Comparisons.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Nonnull | ||
ExplainTokensWithPrecedence explain(@Nonnull Iterable<Supplier<ExplainTokensWithPrecedence>> explainSuppliers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExplainTokensWithPrecedence explain(@Nonnull Iterable<Supplier<ExplainTokensWithPrecedence>> explainSuppliers); | |
ExplainTokensWithPrecedence explain(@Nonnull Iterable<Supplier<ExplainTokensWithPrecedence>> childrenExplainSuppliers); |
...-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/typing/Type.java
Show resolved
Hide resolved
...ore/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/CollateValue.java
Show resolved
Hide resolved
...layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/Value.java
Show resolved
Hide resolved
Result of fdb-record-layer-pr on Linux CentOS 7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work!
* numerous refactorings from describe and explain * rewriting the explain visitor * able to render plan explains * explain levels * unit tests work * touch ups * added documentation * addressing Alec's comments * more renamings * addressing yhatem's comments
* numerous refactorings from describe and explain * rewriting the explain visitor * able to render plan explains * explain levels * unit tests work * touch ups * added documentation * addressing Alec's comments * more renamings * addressing yhatem's comments
Reimplementation of stringification of plans:
ExplainPlanVisitor
to create a token list in a first step then is then rendered in a second stepTreeLike
s getexplain
methods that are called fromtoString()
a. renderer for external explains and logging(supports maximum length as well as different explain levels:
STRUCTURE
,SOME_DETAILS
,ALL_DETAILS
b. renderer for pretty explain