Refactoring of ETL/DbEntity into ETL/DbModel #138
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 PR refactors the existing ETL/DbEntity code into a new namespace (ETL/DbModel) and also removes cruft that was not needed and makes it easier to extend. This work is in preparation for supporting improvements such as better subquery support, programmatic changes to queries and tables during ETL, and renaming columns as opposed to dropping/adding them.
See also PR ubccr/xdmod-xsede#32 for additional required changes.
Note that commit
533b2f3
clearly shows several files as renamed and0969e8f
shows many of the changes to those files but the code shown at the end of the PR shows them deleted and recreated. I'm not sure why this happens.Description
The
ETL\DbEntity
code was largely untouched since inception 1.5 years ago and needed to be updated to support desirable features such as subqueries, change column, and improved programmatic access and modification of tables and queries during ETL (for batch aggregation speed improvements, for example).The newly refactored
ETL/DbModel
code has been updated to continue to support a lightweight representation of database queries and tables.The following changes have been made:
ETL/DBModel
protected
properties array inDbEntity.php
and accessed via__get()
,__set()
, and__isset()
. This means that classes no longer need to implement getters in most cases and only need to extend__set()
for complex data types such as arrays of objects where a particular type of object must be created.stdClass
object that can then be fed back into itself as the configuration object. This allows for programmatic modification of an object on the fly during ETL.Table::discover()
method no longer needed to be static.DbEntity
and classes that extend this class now only implement the definition, verification, and setting of the properties that they define.stdClass
objectsstdClass
representation, and feeding this back to ensure the same statement is generatedMotivation and Context
General code cleanup and preparation for new features. Also added tests.
Tests performed
Component tests were run (
PHPUnit
) and theresource-allocations
andxdcdb-jobs
pipelines were run with their data being compared to the a baseline from v6.6 data. Baseline commands are shown here for reference and were the same options as branch 6.7 executions.Test
resource-allocations
andxdcdb-jobs
pipelinesVerify data in generated tables. Note that the default values for
submission_venue_id
,job_record_type_id
, andjob_task_type_id
have changed between 6.6 and 6.7 so these columns are ignored in the jobs data (we do not currently populate them other than the default).Types of changes
Checklist: