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

SQL search renaming/refactoring #1569

Merged
merged 18 commits into from
Jan 12, 2021
Merged

Conversation

johnstairs
Copy link
Member

@johnstairs johnstairs commented Jan 6, 2021

Description

This PR intends to simplify the code for SQL search by eliminating "Normalized" and "Denormalized" concepts. These were meant to represent columns that were on the search parameter tables and the Resource table, respectively, but created confusion because some (but not all) denormalized columns were also on the search parameter tables.

  • Adding a SearchParameterColumnLocation enum to identify where the columns for a search parameter reside.
  • SqlRootExpression has properties TableExpressions and ResourceExpressions instead of TableExpressions and DenormalizedExpressions.
  • TableExpression consolidates NormalizedPredicate and DenormalizedPredicate properties into a single Predicate property.
  • Introducing SqlChainLinkExpression, which is created from ChainExpressions but includes a ExpressionOnSource property. This means we can get rid of TableExpression.DenormalizedPredicateOnChainRoot, which polluted the TableExpression class with a concept that only applies to chaining.

There should not be any functional changes with in this PR. It is strictly a refactoring (well, mostly a renaming).

{
// if only Include expressions, the case is handled in IncludeMatchSeedRewriter
return expression;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe it's worth to push that check directly into IncludeMatchSeedRewriter as a static method?

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

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

:shipit:

@johnstairs johnstairs merged commit dbbbd25 into main Jan 12, 2021
@johnstairs johnstairs deleted the personal/johnstairs/sql-renaming branch January 12, 2021 22:35
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