Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explain why logic is in SQL and ask for help
Now we have external contributors (hi @chadmiller!), it's time to start thinking more about comprehensibility
- Loading branch information
ce0c22d
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.
Oh man. I had not peeked in view.sql before. That is the most upside-down, CTE-abusing SQL I have ever seen.
ce0c22d
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'll take a try at simplifying and refactoring that, if no one else does.
ce0c22d
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 have made an issue for it: #121
ce0c22d
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 take full responsibility for that mess of SQL.
One note, an update to that SQL is coming down the pike soon (see my pull request #116 ) with some new fields. I don't think it looks much prettier but for the 2nd query it is at least commented out and grouped so someone can understand what is going on better and what the various fields represent.
Still probably needs work to make sensible but I think it's a bit easier to follow.
The first query with the json_extracts is just a hulking mess though.
ce0c22d
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.
ce0c22d
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'll comment that out in my PR. Basically it's pulling in a deprecated data field from a historical dataset that we are using as an exclusionary criteria.
Details here.