-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support for Oracle ETL DataEndpoint (readonly) #34
Conversation
- More flexible database parameters in .ini file (not all databases require all parameters) - Improve handling of DB Engine subclasses (e.g., PostgresDB, MySQLDB) - Improved parameter validation on a per-engine basis - Added methods to iDatabase that should have been there before - General code cleanup - Improve comments
$this->handle = DB::factory($this->config); | ||
} catch (Exception $e) { | ||
$msg = "Error connecting to data endpoint '" . $this->name . "'. " . $e->getMessage(); | ||
$this->logAndThrowException($msg); |
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.
Extra whitespace on line 136?
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.
Interesting that phpcs didn't complain about that.
{ | ||
if ( empty($schemaName) ) { | ||
if ( null === $schemaName ) { | ||
$schemaName = $this->getSchema(); |
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.
Lines 44-49 (from Postgres.php) are seen frequently in these classes that extend aRdbmsEndpoint--is it worth putting a function in aRdbmsEndpoint to handle the test for SchemaName and the logging action?
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.
Yes, that makes sense.
// See http://www.postgresql.org/docs/current/static/catalogs.html | ||
|
||
$sql = "SELECT | ||
username AS name |
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.
Formatting seems off for these SELECT strings (lines 54, 114, 160).
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.
My editor doesn't indent bare strings on the line. Plus, the extra indentation makes it more difficult to read in the debug output.
@@ -0,0 +1,219 @@ | |||
# Oracle Data Endpoint |
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.
Does it make more sense to put this file under configuration/ or docs/, perhaps?
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.
Overall, our documentation needs to be updated to reflect Oracle support (and emphasize that it is read-only for ETL), as well.
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 moved it to docs/etl/data-endpoint-oracle.md. I also need to update the ETL documentation overall and move it out of confluence. There are a lot of docs to move.
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.
Unless the updates to dependencies are directly related to the new dependency I would want to move those updates to a different pull request
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.
Fix travis CI build failures:
Errors:
https://travis-ci.org/ubccr/xdmod/jobs/193879363#L320
https://travis-ci.org/ubccr/xdmod/jobs/193879363#L520
Warnings (decide if needs to be fixed or not):
https://travis-ci.org/ubccr/xdmod/jobs/193879363#L333
Unit test failures:
https://travis-ci.org/ubccr/xdmod/jobs/193879364#L324
@@ -689,8 +728,8 @@ function usage_and_exit($msg = null) | |||
|
|||
NOTE: Date and time options support "+1 day", "now", "now - 1 day", etc. notation. | |||
|
|||
EOMSG | |||
); | |||
EOMSG; |
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.
heredoc requires closing tag to be at the beginning of the line.
Warning
It is very important to note that the line with the closing identifier must contain no other characters, except a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character before the closing identifier must be a newline as defined by the local operating system. This is \n on UNIX systems, including Mac OS X. The closing delimiter must also be followed by a newline.
If this rule is broken and the closing identifier is not "clean", it will not be considered a closing identifier, and PHP will continue looking for one. If a proper closing identifier is not found before the end of the current file, a parse error will result at the last line.
I believe this is what is now causing travis to fail with
PHP Parse error: syntax error, unexpected $end in tools/etl/etl_overseer.php on line 737
…aendpoint Conflicts: tools/etl/etl_overseer.php
…to etl/oracle-dataendpoint Conflicts: tools/etl/etl_overseer.php
Looks good to me once the composer.lock is fixed to not update dependencies. |
Composer lock file reverted. The new file only has timestamps updated and the requirements for PDOOCI. I needed to clear my composer cache or else running |
* Prepare for adding Oracle support - More flexible database parameters in .ini file (not all databases require all parameters) - Improve handling of DB Engine subclasses (e.g., PostgresDB, MySQLDB) - Improved parameter validation on a per-engine basis - Added methods to iDatabase that should have been there before - General code cleanup - Improve comments * Allow methods to override default schema name when checking if schema or table exists * Add support for ORDER BY in ETL queries * Improve debug readability and error messages * Add modern PDO support for Oracle (PDOOCI wraps the OCI8 library) * Support for Oracle ETL data endpoint (readonly) * Style fixes as per phpcs * Address style and unit test errors, rmove underscores from private class members
Implement an ETL DataEndpoint for reading from an Oracle database.
Description
Implements support for importing data from an Oracle database. In addition to adding an Oracle DataEndpoint, the following changes were made as a result of necessary features for importing
Note that Oracle requires downloading the Oracle Instant Client libraries.
Motivation and Context
We will need to pull organizational hierarchy and user affiliations from UB's data warehouse (Infosource). This will also assist SDSC with migration from their existing Oracle system.
Tests performed
Imported the organizational hierarchy from UB's Oracle instance.
Types of changes
Checklist: