Skip to content

Teradata support#307

Closed
MMatten wants to merge 23 commits intodbfit:masterfrom
pmsoftware:master
Closed

Teradata support#307
MMatten wants to merge 23 commits intodbfit:masterfrom
pmsoftware:master

Conversation

@MMatten
Copy link
Copy Markdown
Contributor

@MMatten MMatten commented May 28, 2014

As per overview in #304 to resolve #168 and #7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need that BigDecimal here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's referenced on line 276.

@benilovj
Copy link
Copy Markdown
Member

@MMatten I don't quite understand why changes need to be made to AbstractDbEnvironment. Is it possible to push them down to TeradataEnvironment?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My IDE says that this has no usages - @javornikolov any ideas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any usage either. Similar applies to some other TestHost methods.

@benilovj
Copy link
Copy Markdown
Member

Hmm there's a lot of changes in this pull request. @MMatten I'd prefer to split it into at least two parts:

  • just 1fc6037 (but without the debug statements)
  • the savepoints support (which seems a lot more invasive and needs more discussion)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra trailing space.

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented May 28, 2014

I did initially change AbstractDbEnvironment to allow createStatementWithBoundFixtureSymbols to be overridden and then called either setObject or setNull in TeradataEnviroment. The Teradata driver seems to accept java.sql.Types.NULL as the type regardless of the actual type in the DB whereas other drivers wouldn't (neither would they take Types.VARCHAR and automatically convert).

The Teradata createStatementWithBoundFixtureSymbols was almost identical to that of the super type so I though of eliminating (almost) duplicated code but at the code of changing AbstractDbEnvironment and introducing the supportsSetObjectNull() and getJavaClassSqlType(). I can revert this easily. Let me know your thoughts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is to have sqlType start with small letter.

@javornikolov
Copy link
Copy Markdown
Contributor

I did initially change AbstractDbEnvironment to allow createStatementWithBoundFixtureSymbols to be overridden and then called either setObject or setNull in TeradataEnviroment. The Teradata driver seems to accept java.sql.Types.NULL as the type regardless of the actual type in the DB whereas other drivers wouldn't (neither would they take Types.VARCHAR and automatically convert).

The Teradata createStatementWithBoundFixtureSymbols was almost identical to that of the super type so I though of eliminating (almost) duplicated code but at the code of changing AbstractDbEnvironment and introducing the supportsSetObjectNull() and getJavaClassSqlType(). I can revert this easily. Let me know your thoughts.

Maybe that set NULL support is a good candidate to handle in separate PR (will reduce the complexity of this one).

  • First question is: can we figure out a relatively simple and portable support for that.
  • Maybe extract setObject method in db environment(s).

@javornikolov javornikolov mentioned this pull request May 29, 2014
@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented May 29, 2014

@benilovj Jake, I've realised1fc6037 doesn't build. The change was good for Teradata but breaks other DB types.

I'm not sure how to proceed. Teradata can't work with savepoints and can't work with setObject with a null object ref.

What if I revert the changes to DBEnvironment/AbstractDbEnvironment and make createStatementWithBoundFixtureSymbols overrideable in AbstractDbEnvironment call setNull in the Teradata variant?

I'd have to leave my changes in StatementExecution and SymbolUtil etc though. Otherwise I'll have to wait for you guys to make some core changes.

Heyelp!

@benilovj
Copy link
Copy Markdown
Member

@MMatten we've started making some core changes that will allow you to simplify your pull request quite considerably. Bear with us...

@benilovj
Copy link
Copy Markdown
Member

@MMatten so we've removed handling of savepoints now (#309).

So, to move this change forward:

  • could you please remove the savepoint-handling in your code
  • as @javornikolov suggested, the null handling is best done as a subsequent pull request, straight after this one would be merged.

I think those two points should mean that you wouldn't need any core changes at all...

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented May 31, 2014

@benilovj,

To clarify:

For this pull request I'll: -

  • Abandon my changes to StatementExecution.
  • Abandon the proposed supportsSavepoints method on AbstractDbEnvironment.
  • Abandon the proposed supportsSetObjectNull method on AbstractDbEnvironment.
  • Abandon the other changes to createStatementWithBoundFixtureSymbols.
  • Send you a pull request for the remainder (revised Teradata tests mainly, with a few other fixes to TeradataEnvironment).

This will obviously result in the Teradata code not being usable still and it won't pass tests on in my dev env. But you'll merge this.

I'll then work on a new PR for the null handing to make it all work.

Is this what you are expecting?

@benilovj
Copy link
Copy Markdown
Member

yes that sounds like the best way to proceed.

How many tests are we expecting to be failing without the null handling?

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented May 31, 2014

Not sure off the top of my head. Pretty much anything involving a null!

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 9, 2014

Tests updated/refined and whitespace-only changes reverted with fixes applied.

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 9, 2014

Do I need to disable the TD regression suite, or do you think the 4GB TD setup is ok (even if not the latest version of TD Express that's available)?

@javornikolov
Copy link
Copy Markdown
Contributor

Do I need to disabled the TD regression suite, or do you think the 4GB TD setup is ok (even if not the latest version of TD Express that's avaiable)?

Main question here is - what would be impact on other people which would like to contribute?

So far I managed to find how to skip some tests of specific db: gradlew check -x :dbfit-java:teradata:test.

@javornikolov
Copy link
Copy Markdown
Contributor

I think we can set @Ignore on the Teradata acceptance tests for now. And later we can think of some way for easier way to skip/force the execution of acceptance tests for specified tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execute Ddl?

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 9, 2014

If people are introducing core changes then they really should run all of the suites (as already mentioned in the docs), otherwise they can run the tests for their adapter changes (again, in the docs).

As it looks like there could be more adapters coming down the line (Sybase, Netezza [although no Linux dev version] and may be even Informix) I think maintaining a dev machine running all of these will be a tall order.

So perhaps the current instructions in the docs are spot on.

As far as the VM is concerned, the Oracle and DB2 installations are optional, according to the CONTRIBUTING doc, but the tests are enabled - may be these shouldn't enabled by default either then.

@javornikolov
Copy link
Copy Markdown
Contributor

As far as the VM is concerned, the Oracle and DB2 installations are optional, according to the CONTRIBUTING doc, but the tests are enabled - may be these shouldn't enabled by default either then.

I also wondered about these - the situation is not ideal with them too. Though they're a bit easier to setup and are able to run inside the VM.

Maybe the way to go would be to allow overriding what tests to run or not in some config. file.

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 9, 2014

Yes, I had the same thought; a config file or may be some !defines on a parent FitNesse page to !include or not the actual tests, or something even crazier.

I'll fix up the points you've just spotted.

Specify transaction mode for connection to Teradata when setting up test DB
@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 9, 2014

Done. I've also updated TERADATA.md to specify the transaction mode as TERA else the stored procs will fail, if created using an ANSI mode connection, when called as the current connections in the tests are TERA mode.

@javornikolov
Copy link
Copy Markdown
Contributor

OK, thanks!
Maybe this is already good enough to merge, @benilovj?

@benilovj
Copy link
Copy Markdown
Member

@javornikolov yes I think we're there for this PR.

What I'll do this evening is squash most commits and peel off a few, to get a cleaner commit log.

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 10, 2014

Great. I can then create some new issues for the NULL handling, redundant tests (i.e. to hook into the core tests), the remaining reformatting (that I recently reverted), and to execute the tests in both TERA and ANSI modes.

@benilovj
Copy link
Copy Markdown
Member

Ok, it took some effort but I think I finally have a mergeable, rebased, consolidated branch with just 1 commit which should reflect the changes here exactly:

https://github.com/dbfit/dbfit/compare/pmsoftware-master

Now, one thing I noticed while doing this was that the proposed changes still don't reuse the common "core" tests. This adds a lot more (potentially duplicated) tests, and I'm not sure that there's a good reason for that anymore, since we added the Execute DDL fixture. Is there anything stopping us from reusing the core tests here?

@benilovj
Copy link
Copy Markdown
Member

oh wait - did we decide to do the test reorg on another pull request?

@javornikolov
Copy link
Copy Markdown
Contributor

oh wait - did we decide to do the test reorg on another pull request?

Yes. When the NULL support is sorted out - it should be simpler to just pull the Core tests here.

@MMatten
Copy link
Copy Markdown
Contributor Author

MMatten commented Jun 11, 2014

Ok. Good news. Thanks for all the help on this!

Next up then is addresses the NULL handing and re-enabling the tests including NULLs.

Regarding using the CoreTests - do you this should be in the same PR as the NULLs work or keep it separate?

@benilovj
Copy link
Copy Markdown
Member

Ok. Good news. Thanks for all the help on this!

Thanks for all the hard work!

Regarding using the CoreTests - do you this should be in the same PR as the NULLs work or keep it separate?

Probably best kept separate - will make it easier to review.

@benilovj
Copy link
Copy Markdown
Member

Since #316 is merged, closing.

@benilovj benilovj closed this Jun 11, 2014
@benilovj benilovj added this to the Next Release milestone Jun 11, 2014
This was referenced Sep 6, 2014
@javornikolov javornikolov mentioned this pull request Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you include the TeraData dbfit harness in the compiled build

3 participants