Improve robustness of full groupby checking #1469
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request combines two tightly coupled changes. The underlying issue is
that the ETLv2 code had a deficient check for the correct grouping in aggregate
queries and the etlv1 code autogenerated incorrect grouping configuration.
This change improves the robustness of the ETLv2 groupby check and fixes the
incorrect grouping configuration.
The old ETLv2 code had a php-based check for valid SQL. This didn't handle all
the possible valid cases and allowed an invalid case through. The change
removes this code and instead sets the SQL mode ONLY_FULL_GROUP_BY to get the
SQL server to do the check. Note that not the error is now handled at a
different point in the processing pipeline.
The etlv1 code now uses sql formula in the group by if an sql formula is
defined and the column name in the source table is identical to the column name
in the destination table.
Then there are the changes to the definition files so that correct sql queries are gernerated.