Skip to content

HPCC-35694 Add support to WsDFU.DFUQuery to sort by physical "File Size"#21119

Open
asselitx wants to merge 1 commit intohpcc-systems:candidate-10.2.xfrom
asselitx:hpcc-35694-dfustortby-compressedsize
Open

HPCC-35694 Add support to WsDFU.DFUQuery to sort by physical "File Size"#21119
asselitx wants to merge 1 commit intohpcc-systems:candidate-10.2.xfrom
asselitx:hpcc-35694-dfustortby-compressedsize

Conversation

@asselitx
Copy link
Copy Markdown
Contributor

@asselitx asselitx commented Mar 19, 2026

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@github-actions
Copy link
Copy Markdown

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-35694

Jirabot Action Result:
Changing assignee from: gordon.smith@lexisnexisrisk.com to: terrence.asselin@lexisnexisrisk.com
Workflow Transition To: Merge Pending
Additional PR: #21119

@asselitx asselitx force-pushed the hpcc-35694-dfustortby-compressedsize branch from a963176 to 4814af3 Compare March 19, 2026 16:24
@asselitx asselitx marked this pull request as ready for review March 19, 2026 16:30
Copilot AI review requested due to automatic review settings March 19, 2026 16:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds backend and UI support for sorting DFUQuery results by compressed size / on-disk size semantics, and updates UI to display “File Size” and “Compression” instead of separate size columns.

Changes:

  • Map DFUQuery sort field to @compressedSize and adjust size field population for compressed files.
  • Extend DFULogicalFile to include a FileSize field (v1.68+) and populate it in helpers.
  • Update React/ECLWatch UI formatting and tests to reflect “File Size” / “Compression” display.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
testing/unittests/dalitests.cpp Adds coverage asserting DFUQuery returned size uses compressed size when appropriate.
esp/src/tests/v9-files.spec.ts Updates UI test expectations for renamed columns (“File Size”, “Compression”).
esp/src/src/Utility.ts Extends formatDecimal to support prefix/postfix formatting.
esp/src/src-react/hooks/file.ts Adds shared compression formatting logic for UI.
esp/src/src-react/components/MetricsPropertiesTables.tsx Uses new formatDecimal prefix/postfix for stddev display.
esp/src/src-react/components/LogicalFileSummary.tsx Replaces PercentCompressed with computed Compression display.
esp/src/src-react/components/IndexFileSummary.tsx Updates percent formatting to use new formatDecimal signature.
esp/src/src-react/components/Files.tsx Updates columns to “File Size” and “Compression” and adjusts size/compression formatting.
esp/src/eclwatch/DFUQueryWidget.js Updates percent formatting to use new formatDecimal signature.
esp/services/ws_dfu/ws_dfuService.cpp Adds legacy sort mapping for compressed size attribute.
esp/services/ws_dfu/ws_dfuHelpers.cpp Populates new FileSize (v1.68+) based on available fields.
esp/scm/ws_dfu_common.ecm Adds FileSize to DFULogicalFile (min_ver 1.68).
dali/base/dadfs.cpp Sets DFUQ “size” field to compressed size for compressed files and ensures origsize exists.

Comment thread esp/src/src/Utility.ts
Comment on lines +1194 to +1197
export function formatDecimal(num: number, prefix: string = "", postfix: string = ""): string {
if (!num) return "";
if (isNaN(num)) return num.toString();
return d3FormatDecimal(num);
return prefix + d3FormatDecimal(num) + postfix;
Comment thread esp/src/src-react/components/Files.tsx Outdated
Comment on lines +215 to +221
if (row.FileSize) {
return Utility.convertedSize(row.FileSize);
}
return Utility.convertedSize(row.IsCompressed ? row.CompressedFileSize : row.IntSize);
},
csvFormatter: (value, row) => {
if (row.FileSize) {
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.

Ok adding suggestion to batch.

Comment thread esp/services/ws_dfu/ws_dfuService.cpp
Comment on lines +18 to +23
function formatRatio(isCompressed: boolean, compressedSize: number, totalSize: number): string {
if (!isCompressed || totalSize <= 0) return "";
const ratio = compressedSize / totalSize;
if (!isFinite(ratio)) return "";
return Utility.formatDecimal(100 - ratio * 100, "", "%");
}
@github-actions
Copy link
Copy Markdown

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21119 - HPCC-35694 Add support to WsDFU.DFUQuery to sort by "CompressedSize"
Base Branch: candidate-10.2.x
Test Time: 2026-03-19 16:28:40 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@asselitx asselitx requested a review from GordonSmith March 19, 2026 18:30
@asselitx asselitx changed the title HPCC-35694 Add support to WsDFU.DFUQuery to sort by "CompressedSize" HPCC-35694 Add support to WsDFU.DFUQuery to sort by physical "File Size" Mar 19, 2026
@asselitx asselitx added Bug Notable Change A notable change that is likely to be worth highlighting in any version that is released. labels Mar 19, 2026
Comment thread esp/scm/ws_dfu_common.ecm Outdated
[min_ver("1.63"), nil_remove] int64 MaxSkew;
[min_ver("1.63"), nil_remove] int64 MinSkewPart;
[min_ver("1.63"), nil_remove] int64 MaxSkewPart;
[min_ver("1.68")] int64 FileSize;
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.

Does this need a version bump somewhere else (for the entire service)?

Comment thread esp/src/src-react/components/Files.tsx Outdated
label: nlsHPCC.FileSize,
formatter: (value, row) => {
return Utility.convertedSize(row.IntSize);
if (row.FileSize) {
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.

row.FileSize !== undefined would be preferable.

Comment thread esp/src/src-react/components/Files.tsx Outdated
return Utility.convertedSize(row.IsCompressed ? row.CompressedFileSize : row.IntSize);
},
csvFormatter: (value, row) => {
if (row.FileSize) {
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.

row.FileSize !== undefined is preferable

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21119 - HPCC-35694 Add support to WsDFU.DFUQuery to sort by physical "File Size"
Base Branch: candidate-10.2.x
Test Time: 2026-04-01 16:38:44 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@asselitx
Copy link
Copy Markdown
Contributor Author

asselitx commented Apr 1, 2026

@GordonSmith fixed requested changes and confirmed unittests pass, but didn't touch your code that only copilot commented on. If you do agree with copilot I can make those adjustments also.

@ghalliday
Copy link
Copy Markdown
Member

@asselitx please squash

@ghalliday
Copy link
Copy Markdown
Member

Also the copilot comment about formatting 0 looks relevant.

@asselitx
Copy link
Copy Markdown
Contributor Author

asselitx commented Apr 8, 2026

It looks like the formatDecimal (and others) intentionally return empty string for zero input to avoid cluttering the UI with 0.00% or similar looking output to help draw attention to the more significant nonzero values.

- Expose single field 'FileSize' for physical File Size. Regardless of
  compression status this field has the actual physical size on disk.
- Add FileSize field to DFUQuery response to hold DFUSFSize.
- Update ECL Watch to use FileSize when present.
- Update DFULogicalFile structure and all services using it to version 1.69.
- Update unittests to return all DFU fields needed to pass new tests.

Signed-off-by: Gordon Smith<GordonJSmith@gmail.com>
Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
@asselitx asselitx force-pushed the hpcc-35694-dfustortby-compressedsize branch from ad10c43 to 9ba041a Compare April 8, 2026 19:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🔄 Upmerge Test Results

Status: ✅ All branches merged successfully
PR: #21119 - HPCC-35694 Add support to WsDFU.DFUQuery to sort by physical "File Size"
Base Branch: candidate-10.2.x
Test Time: 2026-04-08 19:23:56 UTC

✅ Successful Branches (1)

  • master
    This comment was automatically generated by the upmerge test workflow.

@asselitx
Copy link
Copy Markdown
Contributor Author

asselitx commented Apr 9, 2026

@ghalliday and @GordonSmith squashed and approved

lFile->setMinSkewPart(file.getPropInt64(getDFUQResultFieldName(DFUQResultField::minSkewPart)));
}

if (version >= 1.68)
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.

I think this should be compare >= 1.69

Copy link
Copy Markdown
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

version question

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

Labels

Bug Notable Change A notable change that is likely to be worth highlighting in any version that is released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants