-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-28576: Add jdbc tests for tpcds queries #5510
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
Conversation
98542c2
to
eb4f642
Compare
@soumyakanti3578, isn't that already covered by TestTezTPCDS30TBPerfCliDriver? |
@deniskuzZ No, TestTezTPCDS30TBPerfCliDriver generates logical plans and uses a stats dump. This is different because here we actually create tpcds tables in Postgres, create external tables in Hive corresponding to the tables in Postgres, and then generate the jdbc plans. |
hi @soumyakanti3578 , why not simply parameterize the db to run tests against? default is derby, which could be overridden. why create a separate driver for that? |
|
Only option I saw was to add something like
With the new driver, we can configure CliConfigs.java to run 1 file to create all tpcds tables once with
and run 1 file to create all external tables once with
and in CoreJdbcCliDriver.java, we can launch the docker container before starting the tests with I think this approach is easier to maintain. But please let me know what your thoughts are regarding this, and if you have something else in mind too! Thanks! |
hi @soumyakanti3578, sorry for not replying, please give me some time, I am overwhelmed with diff requests atm |
@deniskuzZ No problem at all. Thanks for looking into this :) |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
hi @soumyakanti3578, sorry, I didn't grasp the meaning of those tests at first. I'll reopen the PR. Would it make sence to rename init script like:
|
LOG.info("No jdbc init script detected. Skipping"); | ||
return; | ||
} | ||
externalDB = QTestDatabaseHandler.DatabaseType.valueOf("POSTGRES").create(); |
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.
can we reuse QTestDatabaseHandler here?
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.
Unfortunately I don't think we can reuse QTestDatabaseHandler
here.
We want to create a DB in @BeforeClass
method so that the tables are available for all 200 tests. Otherwise we will have to create tpcds tables and corresponding hive external tables again and again for each test file.
QTestDatabaseHandler
is set up to create DB and launch docker for each individual test, as it is done in beforeTest
method.
Please let me know if I am missing something, and if there is a better way to handle this.
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.
QTestDatabaseHandler dbHandler = qt.getDatabaseHandler();
externalDB = dbHandler.initDb("postgres", scriptFile)
|
Thanks @deniskuzZ for reopening the PR. I will look into your suggestions, and also the failure, and revive this PR soon. :) |
hi @soumyakanti3578, please ping me directly, I might miss GitHub notifications. |
eb4f642
to
600367c
Compare
600367c
to
e336caf
Compare
|
@@ -345,6 +347,22 @@ protected void setInitScript(String initScript) { | |||
this.initScript = initScript; | |||
} | |||
} | |||
|
|||
public String getJdbcInitScript() { |
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.
can't we reuse the existing initScript
?
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
What changes were proposed in this pull request?
Add a new test driver for jdbc tests
TestMiniLlapLocalJdbcCliDriver
to create tpcds tables in dockerized postgres, and create corresponding external tables. Generate explain plans for tpcds queries.Why are the changes needed?
To improve JDBC test coverage
Does this PR introduce any user-facing change?
No
Is the change a dependency upgrade?
No
How was this patch tested?