Skip to content

Chunking is broken. #3

@schernichkin

Description

@schernichkin

Chunking will obscure diff results on chunk boundaries if row count does not match.

Steps to reproduce:

  1. Create two tables lager then chunk size different in one row (row should be present only in one table, but not in other).
  2. Run diff.

Result: Diff will indicate deleted row correctly, but will also report identical row deletion and addition on each chunk boundary after the deleted row.

Excepted result: chunking should not affect diff results.

Just to not bother with enomorous chunks:

  1. Change default chunk size to 2.
  2. Run
    val lhs = ReportContent(
      Array(Array("No"),
            Array("0"),
            Array("1"),
            Array("2")), 1,1)
    val rhs = ReportContent(
      Array(Array("No"),
        Array("1"),
        Array("2")), 1,1)
    var diff = TableDiff.produceReportDiff(lhs, rhs)
    println(StringTableDiff.diffReportToString(diff))

Result will be:

+----------+
|No        |
+----------+
|[-0-]{+2+}|
|1         |
|[-2-]     |
+----------+
  1. Change default chunk back to 1000, run the same program. Result will be:
+-----+
|No   |
+-----+
|[-0-]|
|1    |
|2    |
+-----+

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions