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
Apache Phoenix Support #1012
Apache Phoenix Support #1012
Conversation
@jmahonin I got the failing unit test, MigrationTestCase#validateClean to pass by renaming the file, PhoenixCheckValidate1__First.sql to CheckValidate1__First.sql . Since the sqlMigrationPrefix is set as "CheckValidate" in the unit test. |
@anirudha13 Thanks. That's likely the only change in the new PR, but I realized I pushed the last one in error. Can you verify the new one if you have a chance? |
@jmahonin
|
Any idea when Phoenix support will make it into a Flyway release? |
ea2e7b1
to
fae2bc4
Compare
I've just re-upped this PR with a new version that fixes unit tests, and uses an updated Phoenix / HBase version for the tests as well. @anirudha13 @nycjay If you guys can give this branch a test drive and see if it works for you, that'd be awesome. @axelfontaine Please let me know if you'd like any changes made |
@jmahonin thanks. still have a bit of setup work to do on our end, just getting started with phoenix. will reply back when we a chance to test, but it may be a couple of weeks. |
Any updates on this? |
We've been using this in production for months without issue, and the PR has been ready to go for months. It looks like there's some new merge conflicts that we need to resolve though. Do you have any specific comments with the PR? |
Thanks. Could you make it mergeable again? Also, a few things seem problematic:
Cheers |
I'll work on the merge issues. Issue responses:
While I have your attention though, on the first iteration of this PR, I was getting a "SCHEMA" applied migration type for the first entry of the migration table, and then subsequent "SQL" types after that for the real migrations. If I recall, it's triggered by coding around the fact that a schema doesn't exist in Phoenix until a table is created. Everything continued to work properly with this "SCHEMA" entry, although I had to override several of the unit tests that assumed the first entry was 'SQL'. I'm curious if this "SCHEMA" migration type is expected behaviour, or is this something that I should try and avoid having completely? I couldn't really work out the reasoning behind if from the code and comments alone. |
SCHEMA is used when Flyway creates the schema. It is absent when the schema already existed before Flyway ran the first time. |
277a501
to
9d00764
Compare
It has been set up as an EmbeddedDB, although the Phoenix tests are disabled by default unless run in the new 'PhoenixDBTest' profile via: mvn test -P PhoenixDBTest -P-CommercialDBTest -P-InstallableDBTest Notable changes to core classes: * MetaDataTableImpl: Due to Phoenix's peculiar syntax, the hardcoded statements in addAppliedMigration() and updateChecksum() won't work. It now attempts to load a .sql template and run that, if it exists. * MigrationTestCase: Added checks for applied migrations of type MigrationType.SCHEMA and adjusted asserts accordingly. Also added 'getBaseDir()' and 'getMigrationDir()' methods and replaced direct calls to BASEDIR or other hardcode paths with them. Several of the tests in MigrationTestCase can then be used in the Phoenix tests by implementing those method. There are, however, a few cases due to incompatible SQL, or other Phoenix quirks, where specific tests are overridden.
9d00764
to
e13f8e4
Compare
Back to mergeable. Re: 1, I've left it in its own profile. The integration tests take around 5m to run, but if you'd like them in the EmbeddedDBTest profile, let me know Re: 2, I can try roll that into this patch if you'd prefer as well. |
Bump. Any activity here? I'd love to make use of this. |
Thank you Josh for all the work you put into this! Merged. |
Thanks @axelfontaine ! Let me know if there's any further cleanup work you like done. It looks like you've just merged the docs branch in as well, I'll take a once-over to see if there's anything changed there as well, but I suspect it's fine. |
Is there a single jar (no transitive deps) for the jdbc driver that could be shipped out of the box with the Flyway command-line tool? |
There is an assembly client JAR which is self-contained, but not published to maven, available from the Phoenix downloads page [1]. Unfortunately, the client JAR must always be at least the same version or newer than the corresponding server JAR, and to add to the complexity, there are three supported versions of HBase, each with their own client JAR. As well, the Phoenix release cycle is pretty active, so it may be difficult to ship up-to-date versions. Would it be possible instead to package installation instructions specifically for the Phoenix JAR? Most Phoenix users are pretty accustomed to grabbing and moving around the JAR files as necessary anyway. |
Updated PR, reference issue:
#929