Skip to content

feat(vertica-driver): VerticaDriver - #7289

Closed
timbrownls20 wants to merge 60 commits into
cube-js:masterfrom
KnowItAllAus:vertica_driver
Closed

timbrownls20 wants to merge 60 commits into
cube-js:masterfrom
KnowItAllAus:vertica_driver

Conversation

@timbrownls20

@timbrownls20 timbrownls20 commented Oct 24, 2023 •

Copy link
Copy Markdown
Contributor

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

[#690]

Description of Changes Made (if issue reference is not provided)

New @cubejs-backend/vertica-driver package based on vertica-nodejs -- it includes driver itself and basic tests for overridden BaseDriver methods.

published to npm npm i @knowitall/vertica-driver

continuation of this stale PR #5100

@timbrownls20
timbrownls20 requested review from a team as code owners October 24, 2023 04:19
@vercel

vercel Bot commented Oct 24, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 0:50am

@github-actions github-actions Bot added the pr:community Contribution from Cube.js community members. label Oct 24, 2023
@timbrownls20 timbrownls20 changed the title Vertica driver feat(vertica-driver): VerticaDriver Oct 24, 2023
@paveltiunov

Copy link
Copy Markdown
Member

@timbrownls20 Thanks for contributing! Could you please write a readme on your npm package on how to install and use it? We'll add a backlink to it in the third-party driver list.

@paveltiunov paveltiunov self-assigned this Oct 25, 2023
@timbrownls20

Copy link
Copy Markdown
Contributor Author

@timbrownls20 Thanks for contributing! Could you please write a readme on your npm package on how to install and use it? We'll add a backlink to it in the third-party driver list.

No problem. Added instructions to README for the npm package. Wasn't sure what you wanted, so hope this is OK. If you need amends could you post a link to an example. Many Thanks

@codecov

codecov Bot commented Oct 27, 2023 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.04%. Comparing base (5a27200) to head (ea68485).
Report is 32 commits behind head on master.

❗ Current head ea68485 differs from pull request most recent head 04334c0. Consider uploading reports for the commit 04334c0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7289      +/-   ##
==========================================
- Coverage   48.02%   47.04%   -0.99%     
==========================================
  Files         154      155       +1     
  Lines       21019    20768     -251     
  Branches     5264     5224      -40     
==========================================
- Hits        10095     9770     -325     
+ Misses      10723    10678      -45     
- Partials      201      320     +119     
Flag Coverage Δ
cube-backend 47.04% <ø> (-0.99%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paveltiunov

paveltiunov commented Oct 28, 2023 •

Copy link
Copy Markdown
Member

@timbrownls20

Copy link
Copy Markdown
Contributor Author

@timbrownls20 Can you please run yarn run lint:fix to fix most of the code style warnings that arose? and it would be cool if you fix the rest too. Thnx!

No probs - I've fixed some lint issues to other files within the packages that I'd changed. Hope that's what you meant. Cheers

@timbrownls20

Copy link
Copy Markdown
Contributor Author

@timbrownls20 May I kindly ask you to add a page to the docs?

We have a list of supported data sources with linked pages for individual tools, e.g., Postgres. You can find the source code in the same repo: https://github.com/cube-js/cube/tree/master/docs/pages/product/configuration

It would be great if you can add a page for Vertical as well.

You can use this as an icon: https://static.cube.dev/icons/vertica.svg

Hi - docs added. Cheers

@KSDaemon

Copy link
Copy Markdown
Contributor

@timbrownls20 thnx for resolving linter issues! Could you please sync with the upstream? Cause This branch has conflicts that must be resolved. This should be pretty easy! Thnx!

@timbrownls20

Copy link
Copy Markdown
Contributor Author

@timbrownls20 thnx for resolving linter issues! Could you please sync with the upstream? Cause This branch has conflicts that must be resolved. This should be pretty easy! Thnx!

No problem - conflicts resolved

@KSDaemon

KSDaemon commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

@timbrownls20 Thnx for the updates! I was just about to merge, but found a few issues:

Thank you!

@timbrownls20

Copy link
Copy Markdown
Contributor Author

@timbrownls20 Thnx for the updates! I was just about to merge, but found a few issues:

Thank you!

No problem. I've made those changes. Let me know if you need anything else. All the best

@KSDaemon

KSDaemon commented Dec 6, 2024 •

Copy link
Copy Markdown
Contributor

@timbrownls20 Thanks for a quick update! That fixes jest failures!

Sadly, the Vertica test fails.

TypeError: Cannot read properties of undefined (reading 'startContainer')
        10 |
        11 |   beforeAll(async () => {
      > 12 |     container = await VerticaDBRunner.startContainer();

I think that might be due to how you use LogWaitStrategy:

import { LogWaitStrategy } from 'testcontainers/build/wait-strategies/log-wait-strategy';

Maybe try to do it like:

.withWaitStrategy(Wait.forLogMessage("Node Status: v_test_node0001: (UP)"))

Here are docs for testcontainers strategies

@timbrownls20

timbrownls20 commented Dec 11, 2024 •

Copy link
Copy Markdown
Contributor Author

@timbrownls20 Thanks for a quick update! That fixes jest failures!

Sadly, the Vertica test fails.

TypeError: Cannot read properties of undefined (reading 'startContainer')
        10 |
        11 |   beforeAll(async () => {
      > 12 |     container = await VerticaDBRunner.startContainer();

I think that might be due to how you use LogWaitStrategy:

import { LogWaitStrategy } from 'testcontainers/build/wait-strategies/log-wait-strategy';

Maybe try to do it like:

.withWaitStrategy(Wait.forLogMessage("Node Status: v_test_node0001: (UP)"))

Here are docs for testcontainers strategies

So I think the problem is that the vertica runner doesn't exist in the cube repo (yet) so it can't find it - so I've published a version to our own repo https://github.com/knowitall (terrible name - sorry) so it will work and I can raise another PR to point it back to the cube repo. Hope that makes sense - can you see if that fixes the issue. Thanks

EDIT: Seen test is still failing - looking

@KSDaemon

Copy link
Copy Markdown
Contributor

Still see this error in the integration test :(

error: Node startup/recovery in progress. Not yet ready to accept connections

@KSDaemon

KSDaemon commented Jan 6, 2025

Copy link
Copy Markdown
Contributor

Hey @timbrownls20, Merry Christmas and Happy New Year!
Any updates? Let's nail this down! :)
Feel free to ask, if you need some help!

@PolitePp

PolitePp commented Jan 8, 2025

Copy link
Copy Markdown

Hello, dear @KSDaemon
Can you change this row to export TEST_VERTICA_VERSION=12.0.4-0?

11.x is out of support and has some known issues in Docker.

Also, it's better to update this method like this:

export class VerticaDBRunner extends DbRunnerAbstract {
  public static startContainer() {
    const version = process.env.TEST_VERTICA_VERSION || '12.0.4-0';

    const container = new GenericContainer(`vertica/vertica-ce:${version}`)
      .withEnvironment({ TZ: 'Antarctica/Troll', VERTICA_DB_NAME: 'test', VMART_ETL_SCRIPT: '', VMART_ETL_SQL: '' })
      .withExposedPorts(5433)
      .withStartupTimeout(60 * 1000)
      .withWaitStrategy(
        Wait.forLogMessage('Vertica is now running')
      );

    return container.start();
  }
}

It removes some initiation scripts (because they're not required for tests) and this message shows at the end of the initialization (at this stage a database should be run). I don't think that it requires separate PR and I can't edit the current one. I tested it in my repo and the integration passed successfully.

@KSDaemon

KSDaemon commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

@timbrownls20 Hehey! Thnx for the notes! I can't make edits in your fork, so I pulled your changes to the local branch, and updated as you suggest! And..... It works! Yahoo! Finally!
Here is a 🟢 PR, that I plan to merge soon! Thanks again for the hard work!

@KSDaemon KSDaemon closed this Jan 8, 2025

This branch had an error being deployed

1 failed and 7 active (outdated) deployments
Preview — e1aa6e9c Deployed Dec 11, 2024 by vercel[bot]
Preview – examples-react-pivot-table — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-react-dashboard — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-vue-query-builder — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-angular-dashboard — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-react-material-ui — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-react-highcharts — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Preview – examples-react-data-table — 401d379c Deployed Mar 18, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:community Contribution from Cube.js community members.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants