You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Vladimir Sitnikov <si...@gmail.com> on 2015/01/08 18:32:22 UTC
Re: Vagrant/docker dev VM
Julian,
Do you have the test data/scripts for population of mysql, mongodb, and splunk?
I've tried Vagrant+Docker approach and it fails: second startup of VM
fails with "authentication failure" somehow.
It looks like Vagrant+ubuntu14.04+puppet approach works fine.
I plan to create a single VM with all the servers included: mysql,
postgresql, mongodb, splunk, etc.
> I don’t think we should require contributors to run the suite in the VM.
1) The idea is to forward ports from VM to localhost, so the tests are
run as usual "mvn test", and VM is running in the background.
2) Well. What is your suggestion to test the contribution if it fixes
mongodb/splunk code?
We have long-waiting pull requests for mongodb:
https://github.com/apache/incubator-calcite/pulls. The problem is I
have no idea how to test that, so I will not commit them unless I see
how the code works.
We can create separate maven module for integration testing. That
module would require VM to startup (it can even start up the VM in
pre-integration-test step). That will allow everybody to test say
mongodb while general contributions to calcite-core can be tested
without VM (e.g. in travis-ci).
Vladimir
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@hydromatic.net>.
Yes, sorry, keep meaning to try the VM. Been working a lot on my 4GB MacBook Air recently.
And, sorry I broke Mongo. I will fix it.
An assert that goes off due to user code should be changed to an explicit "if ... throw" (if not a real user error). I'll look at how the Mongo code was using the API wrong, and change the assert to something helpful & informative. Hopefully we can make it so that existing code will just work.
I hear what you are saying about major versions and compatibility. However, we have a development style where we produce a feature, let people kick the tires, and fix/adapt it over the following few months. Over those months we will have made several releases, so the code will be "out there". I think it would be ridiculous to release a major version more than once a year. It's more important that we think about our users' convenience, and the burden on Calcite of maintaining absolute compatibility, and find an acceptable balance between the two.
For example, collations never really worked, so any code that used them was by definition experimental. We should ensure that code continues to compile, but we should not slavishly preserve the old functionality.
I have found the '@Deprecated // to be removed before x.x' pattern useful. I can easily search for uses of java.lang.Deprecated in my IDE and remove old APIs just before a given release.
Julian
> On Feb 10, 2015, at 2:12 AM, Vladimir Sitnikov <si...@gmail.com> wrote:
>
> Julian,
>
> Please go ahead and try the VM.
>
> It looks like recent trait changes defeated MongoAdapter (see my
> comment in https://issues.apache.org/jira/browse/CALCITE-507)
>
> The assert line is "assert traits.allSimple();"
> Should we try to use helpful messages for the assertions? Having exact
> contents of "traits" in the assert message would help to analyze
> issues from Drill/Hive/etc.
>
> More interesting question: should we treat this issue as a "backward
> incompatible change"?
>
> If no objections appear, I would add notes from
> https://issues.apache.org/jira/browse/CALCITE-507?focusedCommentId=14311882&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14311882
> to the HOWTO.md.
> That would close CALCITE-507.
>
> Vladimir
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
Julian,
Please go ahead and try the VM.
It looks like recent trait changes defeated MongoAdapter (see my
comment in https://issues.apache.org/jira/browse/CALCITE-507)
The assert line is "assert traits.allSimple();"
Should we try to use helpful messages for the assertions? Having exact
contents of "traits" in the assert message would help to analyze
issues from Drill/Hive/etc.
More interesting question: should we treat this issue as a "backward
incompatible change"?
If no objections appear, I would add notes from
https://issues.apache.org/jira/browse/CALCITE-507?focusedCommentId=14311882&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14311882
to the HOWTO.md.
That would close CALCITE-507.
Vladimir
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
Here's my second try: https://github.com/vlsi/test-dataset
VM creation boils down to a single `mvn install` :)
There are file-based databases (H2, HSQLDB at least), so we need some
plan to integrate Calcite tests with these datasets (basically, JDBC
URL should contain a path to the DB file/folder).
What if we use git submodule for the test data repository, so the data
is always at a single known location?
Note: when this VM becomes official, Calcite's tests would be updated
(expected values as per test data).
If you are using your own Mongo/MySQL/etc and you still want to use
non-VM DBs, please raise your hand.
Things I do not like, but I believe we can live with:
1) foodmart-json looks to contain hand-crafted changes. If I remember
well, mondrian --json format produces a bit different json files. I
did try using mondrian --json first, however I resulted in
pentaho.mondrian-data-foodmart-json:0.3.3 dependency
2) foodmart-json stores dates as strings. As far as I understand,
Mongo supports dates, so some facelifting of the jsons might be
helpful
3) Test machine is always Linux (surprise!), so we might miss
platform-specific bugs (e.g. bugs when MySQL is running on Windows).
Vladimir
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@gmail.com>.
Good idea. Releasing on snapshots is like building on sand.
I have upgraded this to a maven project that knows how to build and release itself. The artifact is { groupId: “net.hydromatic”, artifactId: “foodmart-data-mysql”, version: “0.9” } and it is deployed to the conjars.org repository.
I checked in the source as a github repo: https://github.com/julianhyde/foodmart-data-mysql.
The contents of the jar are almost the same same (data.sql, after.sql, LICENSE). I updated NOTICE and pom.xml, and added git.properties.
Julian
On Jan 18, 2015, at 7:58 AM, Vladimir Sitnikov <si...@gmail.com> wrote:
>> Feel free to check into it as many large files as you want to.
>
> I wonder if I can have non-snapshot version of
> http://repository.pentaho.org/content/groups/omni/pentaho/mondrian-data-foodmart/
> It it had a fixed version number, we could easier reuse the data set.
>
> Of course I can download the jar once, extract it and put into my own
> repository, however it is a bit weird.
>
> BTW: having snapshot versions of dependencies in mondrian is not good
> either: previous versions would fail to pass the tests if snapshot is
> updated.
>
> Vladimir
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
> Feel free to check into it as many large files as you want to.
I wonder if I can have non-snapshot version of
http://repository.pentaho.org/content/groups/omni/pentaho/mondrian-data-foodmart/
It it had a fixed version number, we could easier reuse the data set.
Of course I can download the jar once, extract it and put into my own
repository, however it is a bit weird.
BTW: having snapshot versions of dependencies in mondrian is not good
either: previous versions would fail to pass the tests if snapshot is
updated.
Vladimir
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
> It occurs to me that the “vm” module doesn’t depend on other calcite modules, and vice vers
Suppose we add H2 database test DB. This database works of a file
system, and the file name is given in the JBDC URL.
If the "vm" project is checked out to some random location, it would
be hard to make Calcite tests know the location of the database files.
Well, a set of properties or environment variables can solve that,
however it would stand in the way.
We could add "/vm" folder to .gitignore and recommend checking out the
VM project there, however it might play better as a git submodule.
Vladimir
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
>Treating JDBC as “just another adapter” would be purity for purity’s sake.
I suggest to use "integration" term as soon as the test requires
"setup of external" system.
For instance, if a test requires "live mysql", then it is an integration test.
If a test can be executed against embedded db, then it can be a unit test.
>2. This will mean that 90% or more of tests in an adapter are flagged integration tests. Doesn’t seem quite right.
We can continue run JDBC tests against hsqldb _and_ reuse the same
tests (e.g. via inheritance) in the integration suite to test queries
against mongo, mysql, etc.
> We can’t declare those as integration tests. They should be declared as parameterized tests.
I suggest using "hsqldb unit test" and a set of integration tests for
mongo/mysql/etc.
>1. Is there a way to move a test from regular to integration without moving/copying code (e.g. by adding an annotation?) We might want to move a test to integration for performance reasons. I don’t want to move/copy code for that.
Manen convention is to use *Test.java for unit tests and *IT.java for
integration tests.
Do you think we would need to move code often?
Vladimir
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@gmail.com>.
It occurs to me that the “vm” module doesn’t depend on other calcite modules, and vice versa. It could be a separate project, and maybe it should be. I suggest the following. Develop this as a separate github repo. Feel free to check into it as many large files as you want to.
It will be a tool used by Calcite committers, but it won’t be part of the Calcite release.
We can always re-visit this decision later.
Julian
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@hydromatic.net>.
On Jan 9, 2015, at 1:10 PM, Vladimir Sitnikov <si...@gmail.com> wrote:
>> I thought you mind just check in the MySQL dump as part of the script that creates the VM.
>
> Do you mean check in all the dumps into calcite repository?
> I do not like this very much since it would increase the repository
> size and there is no easy way out.
>
> I would rather prefer referencing some external blobs.
> Those blobs (dumps for mongodb, mysql, splunk, etc) are required just
> in case you test those adapters while the increase in repository size
> would hit all the developers.
How about this… put those resources into maven jars (similar to net.hydromatic.tpcds and pentaho.mondrian-data-foodmart-hsqldb and pentaho.mondrian-data-foodmart-json). You will need a small project to create each maven resource, and you can create a github repo for that. The raw data will of course be checked into the repo but very few people will ever need to pull or edit the git repo; they will use the maven artifact.
https://github.com/julianhyde/tpcds is an example of such a repo.
If you create something similar we can “release” to conjars.org.
Julian
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@hydromatic.net>.
On Jan 9, 2015, at 1:10 PM, Vladimir Sitnikov <si...@gmail.com> wrote:
> Here's first cut of Vagrant + librarian-puppet + puppet = mongodb
> (zips, foodmart) + mysql (foodmart) + postgresql (foodmart):
> https://github.com/apache/incubator-calcite/pull/41
>
> Please give it a try.
Trying it now…
> What is the way to populate mongodb then?
> I am afraid mongoimport does not support hsqldb input files.
>
> Main problem: the input data sets are _not_ stable.
> For instance, zips.json evolved from 29467 to 29353 rows.
>
> I believe we need to fix the data into a stable artifact somehow.
Yes. Let’s just take a snapshot of zips and use that going forward. Put it into your maven branch for now. We’ll move it into a maven artifact before we commit your changes to master.
>
>> “mvn test” is, and should remain, the gold standard
>
> Please see how I modified mongo tests in my vagrant PR: i moved mongo
> tests to integration-test phase, so `mvn test` does _not_ launch
> those, while `mvn verify` tries to hit mongo.
>
> I think it is a good separation, so we can make
> mongodb/mysql/postgresql tests enabled by default provided the tests
> are run in integration-test phase.
The idea of integration tests is basically OK. But:
1. Is there a way to move a test from regular to integration without moving/copying code (e.g. by adding an annotation?) We might want to move a test to integration for performance reasons. I don’t want to move/copy code for that.
2. This will mean that 90% or more of tests in an adapter are flagged integration tests. Doesn’t seem quite right.
3. The databases (hsqldb, mysql, postgres) are a special case. We want to run the regular tests (i.e. the ones in core that use the JDBC adapter) three times over. We can’t declare those as integration tests. They should be declared as parameterized tests.
And before you say it, I don’t think we should disable the JDBC tests by default. I think that JDBC is a very convenient source of reasonable-sized data sets to exercise the core module. Treating JDBC as “just another adapter” would be purity for purity’s sake.
Julian
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
Here's first cut of Vagrant + librarian-puppet + puppet = mongodb
(zips, foodmart) + mysql (foodmart) + postgresql (foodmart):
https://github.com/apache/incubator-calcite/pull/41
Please give it a try.
14 of 27 mongo tests fail.
> I thought you mind just check in the MySQL dump as part of the script that creates the VM.
Do you mean check in all the dumps into calcite repository?
I do not like this very much since it would increase the repository
size and there is no easy way out.
I would rather prefer referencing some external blobs.
Those blobs (dumps for mongodb, mysql, splunk, etc) are required just
in case you test those adapters while the increase in repository size
would hit all the developers.
>If you feel like going the extra 10 miles
I execute MondrianFoodMartLoader via single pom.xml, so I believe it
is the easiest approach.
> Loader scripts and dumps for other databases (including the MySQL script I just created) are derived, and I don’t want to get involved in managing them, whether on github, s3 or anywhere.
What is the way to populate mongodb then?
I am afraid mongoimport does not support hsqldb input files.
Main problem: the input data sets are _not_ stable.
For instance, zips.json evolved from 29467 to 29353 rows.
I believe we need to fix the data into a stable artifact somehow.
> “mvn test” is, and should remain, the gold standard
Please see how I modified mongo tests in my vagrant PR: i moved mongo
tests to integration-test phase, so `mvn test` does _not_ launch
those, while `mvn verify` tries to hit mongo.
I think it is a good separation, so we can make
mongodb/mysql/postgresql tests enabled by default provided the tests
are run in integration-test phase.
Vladimir
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@hydromatic.net>.
The canonical data set is in a maven repo:
<dependency>
<groupId>pentaho</groupId>
<artifactId>mondrian-data-foodmart-hsqldb</artifactId>
<version>0.2</version>
<scope>test</scope>
</dependency>
It is an hsqldb database inside a jar file.
It was what Calcite uses when it runs its tests from hsqldb; it is also the source used by the MondrianFoodMartLoader program to load into other database.
Loader scripts and dumps for other databases (including the MySQL script I just created) are derived, and I don’t want to get involved in managing them, whether on github, s3 or anywhere.
I thought you mind just check in the MySQL dump as part of the script that creates the VM. If you feel like going the extra 10 miles, you could copy Mondrian’s loader (although it is embedded in Mondrian right now, it basically consists of just MondrianFoodMartLoader.java and loadFoodMart.sh).
Julian
On Jan 9, 2015, at 6:39 AM, Ted Dunning <te...@gmail.com> wrote:
> On Fri, Jan 9, 2015 at 1:18 AM, Vladimir Sitnikov <
> sitnikov.vladimir@gmail.com> wrote:
>
>> Any ideas, where permanent data set can be stored?
>>
>
> S3 comes to mind.
Re: Vagrant/docker dev VM
Posted by Ted Dunning <te...@gmail.com>.
On Fri, Jan 9, 2015 at 1:18 AM, Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:
> Any ideas, where permanent data set can be stored?
>
S3 comes to mind.
Re: Vagrant/docker dev VM
Posted by Vladimir Sitnikov <si...@gmail.com>.
Julian,
While dump file is helpful for initial try, it is not very reproducible.
I thought I could use "fetch Mondrian from Maven, and exec importer".
This should result in reproducible VM creation, however it looks like
http://repository.pentaho.org/ is down.
I think it is better to do as little as possible in the VM itself
(e.g. avoid installation of java in the VM) to speed up VM creation
and reduce disk requirements.
Any ideas, where permanent data set can be stored?
Well, I guess dump files can be distributed via some special github or
bintray repository, however I do not like very much the approach of
storing blob dumps.
Vladimir
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@gmail.com>.
Since loading foodmart data set into MySQL is tricky, I have created a dump file and placed it on my server: http://www.hydromatic.net/mysql-foodmart.sql.bz2
Vladimir, you could use this in your VM build script.
Anyone who wants a copy should take one before I remote it on Sunday.
Julian
Re: Vagrant/docker dev VM
Posted by Julian Hyde <ju...@hydromatic.net>.
On Jan 8, 2015, at 9:32 AM, Vladimir Sitnikov <si...@gmail.com> wrote:
> Do you have the test data/scripts for population of mysql, mongodb, and splunk?
To load MySQL: http://mondrian.pentaho.com/documentation/installation.php#MySQL_on_Linux_example
MongoDB: see https://github.com/apache/incubator-calcite/blob/master/doc/HOWTO.md
Splunk: see https://github.com/apache/incubator-calcite/blob/master/doc/HOWTO.md.
> I've tried Vagrant+Docker approach and it fails: second startup of VM
> fails with "authentication failure" somehow.
> It looks like Vagrant+ubuntu14.04+puppet approach works fine.
>
> I plan to create a single VM with all the servers included: mysql,
> postgresql, mongodb, splunk, etc.
That would be awesome.
>
>> I don’t think we should require contributors to run the suite in the VM.
>
> 1) The idea is to forward ports from VM to localhost, so the tests are
> run as usual "mvn test", and VM is running in the background.
> 2) Well. What is your suggestion to test the contribution if it fixes
> mongodb/splunk code?
We should set the bar fairly low for contributors. We should require contributors to run just “mvn test” (i.e. just core, against hsqldb). At their discretion, they can run other tests if it is possible that their changes broke them. But we should not require it.
Committers, on the other hand, must run the full suite before committing. (Automated pre-commit testing would be nice but we your VM would allow manual pre-commit testing, and that is good enough.)
I will also set up a regular full run (maybe using your VM on my home linux server) to make sure that everything runs.
> We have long-waiting pull requests for mongodb:
> https://github.com/apache/incubator-calcite/pulls. The problem is I
> have no idea how to test that, so I will not commit them unless I see
> how the code works.
My bad. There is bit-rot on the MongoDB support.
If you need to, disable tests and log a JIRA case to re-enable them. I would rather have a regular run of a limited set of tests.
> We can create separate maven module for integration testing. That
> module would require VM to startup (it can even start up the VM in
> pre-integration-test step). That will allow everybody to test say
> mongodb while general contributions to calcite-core can be tested
> without VM (e.g. in travis-ci).
That would be awesome.
Julian