Tables not defined in 'tableOrdering' option should be used in resulting dataset
See original GitHub issueHi everyone. I noticed strange behavior with using ‘tableOrdering’ option. For example I have 3 tables in my dataset.yml file: first_table, second_table and third_table. And in annotation ‘@DataSet’ I set ‘tableOrdering’, but add there 2 tables instead of 3: first_table and second_table. As a result, delete and insert operations isn’t executed for this table and test failed. I didn’t found any warning or error logs.
Database rider version: 1.16.0
dataset.yml
first_table:
- name: first_record
- name: second_record
second_table:
- name: first_record
- name: second_record
third_table:
- name: first_record
- name: second_record
@Test
@DataSet(value = "dataset.yml", tableOrdering = {"first_table", "second_table"})
@ExpectedDataSet(value = "dataset.yml")
void retrieveAll() throws Exception {
After debugging I found, that in ‘DataSetExecutorImpl.performTableOrdering(DataSetConfig dataSet, IDataSet target)’
private IDataSet performTableOrdering(DataSetConfig dataSet, IDataSet target) throws AmbiguousTableNameException {
if (dataSet.getTableOrdering().length > 0) {
target = new FilteredDataSet(new SequenceTableFilter(dataSet.getTableOrdering(), dbUnitConfig.isCaseSensitiveTableNames()), target);
}
return target;
}
We set FilteredDataSet and his field _filter contains tables only from ‘tableOrdering’ property. As a result all Iterators of this dataset iterate only by those tables.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
65916 - Accessing a Google BigQuery table without including ...
When you issue a LIBNAME statement for a Google BigQuery database without including the SCHEMA= option, all tables in the project are shown ......
Read more >Create and use tables | BigQuery - Google Cloud
Describes how to create and use standard tables in BigQuery. ... Create an empty table without a schema definition; Create a table from...
Read more >Package 'data.table'
A logical indicating whether or not to ignore rows order in data.table. This option requires datasets to use data types on which join...
Read more >DataItemLinkType Property - Dynamics NAV - Microsoft Learn
Use Default Values If No Match, The resulting dataset contains all ... If the DataItemLinkType property is set to SQL Advanced Options and ......
Read more >Stata Customizable Tables and Collected Results Reference ...
That is not the same thing. table went back through the dataset, ... Our result options increase dramatically if we collect summarize, detail....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, I agree with you. Current situation is bad and error with incorrect ordering is much better=)
Sure, in this case add all tables present in dataset in tableOrdering to avoid surprises. Also you’ll probably get a constraint violation error if the order is incorrect and then you can fix it. In current situation the table which is not present in tableOrdering is simple removed from the dataset so you don’t even get an error because the table is not populated.