-
Notifications
You must be signed in to change notification settings - Fork 7
Migrate to Private Docker Image & Add Federated Queries Test Suite #21
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b4cf660
Using customized private repo
mkottakota1 2bc6aee
Rebuild DB
mkottakota1 107d3f1
Create Fresh DB
mkottakota1 ab79fc6
Installing Iproute package
mkottakota1 c126833
ensure we are running make in the exact folder where the Makefile sits
mkottakota1 96f20db
Passing DB Password
mkottakota1 7198700
Add wget installable
mkottakota1 7e00911
Add VSQL ENV Var for running tests
mkottakota1 5abdc12
Coping odbc.ini files to etc folder
mkottakota1 17a56e9
Finding correct so file name
mkottakota1 9a8d1f8
Introducing federted queries test and skipping copy_test
mkottakota1 30c5fd9
Updated federated test out file
mkottakota1 d313c51
Adding more info to test run
mkottakota1 c14c3f4
Added error handling and removed hardcoded DB password
mkottakota1 4af4453
corrected the commane for column pruning test
mkottakota1 acc4011
Removing hardcoded USERNAME
mkottakota1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| Timing is off. | ||
| SET | ||
| CREATE TABLE | ||
| id | name | ||
| -----+--------- | ||
| 101 | Alice | ||
| 102 | Bob | ||
| 103 | Charlie | ||
| (3 rows) | ||
|
|
||
| id | ||
| ----- | ||
| 101 | ||
| 102 | ||
| 103 | ||
| (3 rows) | ||
|
|
||
| CREATE TABLE | ||
| OUTPUT | ||
| -------- | ||
| 4 | ||
| (1 row) | ||
|
|
||
| id | name | status | ||
| -----+---------+---------- | ||
| 101 | Alice | inactive | ||
| 102 | Bob | active | ||
| 103 | Charlie | inactive | ||
| (3 rows) | ||
|
|
||
| id | name | ||
| -----+--------- | ||
| 101 | Alice | ||
| 102 | Bob | ||
| 103 | Charlie | ||
| (3 rows) | ||
|
|
||
| DROP TABLE | ||
| DROP TABLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| \timing off | ||
|
|
||
| -- Set output to a fixed timezone regardless of where this is being tested | ||
| set time zone to 'EST'; | ||
|
|
||
| -- ===================================================== | ||
| -- Federated Queries Test Case | ||
| -- ===================================================== | ||
| -- This test demonstrates the use of ODBCLoader for federated queries | ||
| -- allowing Vertica to query external databases (e.g., MySQL) while | ||
| -- leveraging predicate pushdown and column pruning to minimize data movement | ||
|
|
||
| -- Create an External Table in Vertica that acts as a gateway to MySQL | ||
| -- The External Table definition stores metadata about the external source | ||
| -- but does not retrieve any data until queried | ||
| CREATE EXTERNAL TABLE public.epeople ( | ||
| id INTEGER, | ||
| name VARCHAR(20) | ||
| ) AS COPY WITH | ||
| SOURCE ODBCSource() | ||
| PARSER ODBCLoader( | ||
| connect='DSN=MySQL', | ||
| query='SELECT * FROM testdb.people' | ||
| ); | ||
|
|
||
| -- Test 1: Query with predicate pushdown | ||
| -- When executing a query with a WHERE clause, ODBCLoader rewrites the original | ||
| -- external query to include the predicate, pushing the filter to the external database | ||
| -- This minimizes the amount of data transferred from MySQL to Vertica | ||
| -- Expected: Only people with id > 100 are retrieved from MySQL | ||
| SELECT * FROM public.epeople WHERE id > 100; | ||
|
|
||
| -- Test 2: Query with column pruning | ||
| -- When only specific columns are selected, ODBCLoader optimizes the external source query | ||
| -- to fetch only the required columns, reducing data transfer from the remote database. | ||
| -- Unselected columns are not fetched and do not appear in the query result. | ||
| -- Expected: Only id column is fetched from MySQL (name column is not selected, so it is not fetched) | ||
| SELECT id FROM public.epeople WHERE id > 100; | ||
|
|
||
| -- Test 3: Federated join query | ||
| -- Demonstrates joining an external table (MySQL) with a Vertica-managed table | ||
| -- This leverages both databases' query engines for optimal performance | ||
| -- Create a temporary Vertica table for joining | ||
| CREATE TABLE public.employee_status ( | ||
| id INTEGER, | ||
| status VARCHAR(20) | ||
| ); | ||
|
|
||
| INSERT INTO public.employee_status VALUES | ||
| (1, 'active'), | ||
| (101, 'inactive'), | ||
| (102, 'active'), | ||
| (103, 'inactive'); | ||
|
|
||
| -- Perform a federated join combining data from MySQL (epeople) and Vertica (employee_status) | ||
| -- The ODBCLoader will push down predicates to MySQL when possible | ||
| SELECT epeople.id, epeople.name, employee_status.status | ||
| FROM public.epeople | ||
| JOIN public.employee_status ON epeople.id = employee_status.id | ||
| WHERE epeople.id > 100; | ||
|
|
||
| -- Test 4: Complex predicate pushdown | ||
| -- Multiple predicates are combined and pushed to the external database | ||
| -- Expected: MySQL executes: SELECT * FROM testdb.people WHERE id > 50 AND id < 150 | ||
| SELECT id, name FROM public.epeople WHERE id > 50 AND id < 150; | ||
|
|
||
| -- Clean up external and temporary tables | ||
| DROP TABLE public.epeople; | ||
| DROP TABLE public.employee_status; |
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.
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.
No error handling if the create fails
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.
Added error handling at necessary stages