Skip to content
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

Test whether a recordset is a subset of an asserted recordset #196

Closed
rvdpluijm opened this issue Jun 15, 2016 · 8 comments
Closed

Test whether a recordset is a subset of an asserted recordset #196

rvdpluijm opened this issue Jun 15, 2016 · 8 comments

Comments

@rvdpluijm
Copy link

We're currently testing our financial data warehouse using NBI. An essential part of this is testing whether the ETL handles incrementals in a correct manner. Therefore, I have to check whether all records from the staging tables have been transferred to the data warehouse fact tables

Is it therefore possible to use an "contains" or "is contained by" assertion to check whether the checked recordset is a proper subset / superset of the asserted recordset (or could that feature be implemented)?

@FuegoArtificial
Copy link

Hi rvdpluijm,

just as a possible point of start, perhaps the assertion subsetof could work. I'd give it a try. although it's just documented for a list of items, it might work for a resultset?
another approach would be if you take a query result comparison where one query returns the DWH-fact table values and the assertion returns a result after an inner join between the fact table and the staging values. it might not be enough for your scenario, yet. However, building two queries will at some point achieve your goal.

my two cents :)

@rvdpluijm
Copy link
Author

rvdpluijm commented Jun 16, 2016

@FuegoArtificial Sadly, that didn't work. It conflicted with the XSD:

Validation of current file using XML schema:

ERROR: Element '{http://NBi/TestSuite}query': This element is not expected. Expected is one of ( {http://NBi/TestSuite}item, {http://NBi/TestSuite}predefined, {http://NBi/TestSuite}range-integer, {http://NBi/TestSuite}range-date, {http://NBi/TestSuite}range-integer-pattern, {http://NBi/TestSuite}one-column-query, {http://NBi/TestSuite}members ).
ERROR: Element '{http://NBi/TestSuite}query': This element is not expected. Expected is one of ( {http://NBi/TestSuite}item, {http://NBi/TestSuite}predefined, {http://NBi/TestSuite}range-integer, {http://NBi/TestSuite}range-date, {http://NBi/TestSuite}range-integer-pattern, {http://NBi/TestSuite}one-column-query, {http://NBi/TestSuite}members ).

I'll check whether I can build an approach using your guidance. Thanks!

@Seddryck
Copy link
Owner

@rvdpluijm It's not supported at the moment but shouldn't be too difficult to implement. Will check.

@Seddryck Seddryck added this to the v1.14 milestone Aug 11, 2016
@Seddryck Seddryck modified the milestones: v1.15, v1.14 Jan 21, 2017
@Seddryck Seddryck modified the milestones: v1.16, v1.15 Feb 8, 2017
@Seddryck Seddryck modified the milestones: v1.15, v1.16 Aug 16, 2017
@Seddryck Seddryck added this to Started in Current release Aug 27, 2017
@Seddryck Seddryck self-assigned this Aug 27, 2017
@Seddryck
Copy link
Owner

Seddryck commented Aug 27, 2017

It will be too complex to have the same names for constraints on collection (equivalentTo, subsetOf and contains) and constraints on result-sets (queries - currently only equalTo). If I was attempting to follow the initial idea (having the same names for both), the XML definition would be a nightmare to parse and code.

I'm planning to

  • continue to support subsetOf in versions 1.X for collection but start to recommend contained-in.
  • for result-sets (queries), I'm planning to use subset-of and superset-of.

@FuegoArtificial @zakwillis @BenCurvers @rvdpluijm
Your comments and other suggestions are welcome!

If validated I should update #288

@FuegoArtificial
Copy link

I like the idea to distinguish the naming if it would be too complex to implement otherwise.

Though, while thinking in "sets" when using semantic models like elements of a dimension and writing MDX-queries (SET x AS {x,y}), I would stick with the wording "subset" when being in this semantic model domain like OLAP Cubes.
Synonyms could be "containedIn" or "includedIn" as wikipedia suggests similarily in the definition of subsets: https://en.wikipedia.org/wiki/Subset
This would have the advantage of backward compatibility as well while you wouldn't need to change predicates for the current semantic.
What do you think?

@zakwillis
Copy link

zakwillis commented Aug 28, 2017 via email

@Seddryck
Copy link
Owner

Seddryck commented Sep 2, 2017

It's available in a preview of release 1.16: https://ci.appveyor.com/project/Seddryck/nbi/build/1.16.0-ci.1

@Seddryck Seddryck removed this from Started in Current release Sep 2, 2017
@Seddryck Seddryck closed this as completed Sep 2, 2017
@Seddryck Seddryck added this to In beta in Current release Sep 2, 2017
@Seddryck Seddryck modified the milestones: v1.16, v1.15 Sep 2, 2017
@Seddryck
Copy link
Owner

documentation is available at http://www.nbi.io/docs/compare-superset-subset/ but the title of the page is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants