You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-2Lines changed: 59 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,27 @@ A handy tool named **Bold/CompressedComparator** can compare two tables to figur
14
14
15
15
## Concept
16
16
17
+
### Headers
18
+
When the data is parsed, the first row (after ignored rows before it) is treated as headers. And the columns referenced by this header.
19
+
20
+
### Compressed
21
+
The Data carried by Table can be compressed to reduce the size of execution profile. Also it can be disabled by setting
22
+
```java
23
+
CompressedTableFactory
24
+
.build("csv")
25
+
.compressed(false)
26
+
.build();
27
+
```
28
+
This is useful in handling large data set.
29
+
17
30
### Table Type
18
31
* CSV: the source type of CSV file to parse
19
32
* Excel: the source type of Excel file to parse
20
33
21
-
### Keys
34
+
### Key Sets
22
35
When a Table is parsed, the key set need to be set to Table thus table knows how to index the content and later those data can be queried. Each KeySet contains one or multiple columns which are represended by headers.
36
+
To understand multiple Key Sets, you can imagine the name card, one person(Row in the case) could have multiple name cards, one is business card the other may be a social name card or family card, the name or identification on the card could be different but the purpose is to reveal to link it to the real human identity.
37
+
Here, in Table, a Row could have multiple Keys to represent itself.
23
38
24
39
One **Bold/KeySet** contains:
25
40
* One or Multiple headers or Columns
@@ -34,11 +49,24 @@ The **Bold/KeyHeadersList** represents the KeySets.
34
49
### Delimeter
35
50
This is for CSV parsing, a delimeter can be specified if it is other than comma
36
51
52
+
## Comparison
53
+
The Compressed Comparator is to compare two Tables to find out the disparities.
54
+
55
+
### ComparatorListener
56
+
This is a call back interface usd by comparator to let outside world known what's happened during the process.
37
57
58
+
### CompressedComparatorFactory
59
+
This is the factory to initialize the Comparator you prefer.
60
+
* before() and after() to specify two tables
61
+
* ignoredFields() to set the Fields/Columns you don't want to compare thus fields won't appear in result
62
+
* comparatorListener() to set the call back listener
63
+
* trim() is to let the process trim the data fields or not
64
+
* strictMissed() this is the switch in case the columns are missed in before or after, and it is to enable the comparison on this column. If it is true, then any rows in the tables will be mismatch if there are any missed columns in table.
38
65
39
66
## Examples
40
67
41
-
### Parse a table
68
+
### Parse a table with single key set
69
+
In this case, the key is composition keys of two columns of "Customer Id" and "First Name":
In this case, there are two key sets used to identify a row by one set of {"Customer Id", "First Name"}, the other key set is {"Phone 1", "Phone 2", "Email"}
0 commit comments