Skip to content

[SYSTEMDS-3857] set get names on dataframes - #2495

Open
t99-i wants to merge 19 commits into
apache:mainfrom
t99-i:SYSTEMDS-3857-set-get-names-on-dataframes
Open

[SYSTEMDS-3857] set get names on dataframes#2495
t99-i wants to merge 19 commits into
apache:mainfrom
t99-i:SYSTEMDS-3857-set-get-names-on-dataframes

Conversation

@t99-i

@t99-i t99-i commented Jun 21, 2026

Copy link
Copy Markdown

This PR extends the handling of frame column names by introducing support for retrieving and updating column names in DML, improving metadata propagation across frame operations, and fixing a remaining metadata propagation edge case.

Changes:

  • Added getNames() and setNames() built-in functions for frame column names.
  • Extended parser, translator, and runtime support for the new operations.
  • Introduced runtime storage of column names in FrameObject as an authoritative metadata source.
  • Implemented metadata propagation for relevant frame operations (CP and Spark), including initialization during frame creation and import.
  • Added utilities for merging and updating column name metadata where required.
  • Fixed a remaining one-off metadata propagation bug affecting distributed frame representations.
  • Added regression and propagation tests covering the new functionality.
  • Added column name propagation tests for cbind, rbind, and slice
  • Updated DML language reference

Motivation:

Previously, frame column names could not be modified through DML and were not consistently preserved across frame operations, particularly for distributed frame representations. This PR provides a consistent runtime representation for column name metadata while maintaining backward compatibility.

Tests:
Added unit tests for getNames() and setNames().
Added metadata propagation tests for relevant frame operations.
Added regression tests for the one-off propagation bug.
Verified existing frame functionality remains unchanged.

t99-i added 5 commits June 14, 2026 17:36
- fix dim for SetNames
- implemented tests for SetName and GetName
- add a test for propagation of column names during cbind operations
- test for other operations following
This patch adds the language references for the newly implemented getName and setName function.
The order in Builtins.java was fixed to be alphabetical again
@t99-i t99-i changed the title Systemds 3857 set get names on dataframes [SYSTEMDS-3857] set get names on dataframes Jun 21, 2026

@janniklinde janniklinde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR @t99-i. I left some comments in the code that should be addressed.

In general, please configure your IDE to use tabs instead of spaces. Also, please remove the unnecessary TODO comments.

As a next step, please implement support for the spark backend and add the according tests. In general, you should have a more systematic approach to verifying metatdata propagation through tests as you currently only include cbind/rbind/slice for the CP backend (should be extended to spark backend and should test other frame related functions systematically).

Comment thread src/main/java/org/apache/sysds/parser/DMLTranslator.java
Comment thread src/main/java/org/apache/sysds/parser/BuiltinFunctionExpression.java Outdated
Comment thread src/test/java/org/apache/sysds/test/functions/frame/FrameColumnNamesTest.java Outdated
Comment thread src/test/java/org/apache/sysds/test/functions/frame/FrameColumnNamesTest.java Outdated
Comment thread src/main/java/org/apache/sysds/runtime/instructions/InstructionUtils.java Outdated
@github-project-automation github-project-automation Bot moved this from In Progress to In Review in SystemDS PR Queue Jun 24, 2026
t99-i added 3 commits July 7, 2026 22:12
- fixed mapping of binarOP in DMLTranslator
- added size/data validation in BinaryFrameFrameCPInstruction
- setName does now have a STRING return type
- removed duplicated code
- fixed get/set-swap
- removed unnecessary prints in FrameColumnNamesTest
- removed unnecessary TODOs
- added SetName functionality for SPARK
- extended propagation test (wip)
- added Set/GetNames function tests for SPARK
@t99-i
t99-i marked this pull request as draft July 19, 2026 13:19
t99-i added 8 commits July 19, 2026 15:39
- Adapted BuiltinNarySPInstruction to carry over columnNames on FrameBlocks
- Removed SetColumnNamesFunction from FrameAppendRSPInstruction
- Adapted MLContextConversionUtil to carry over columnNames on FrameBlocks
- Adapted ParameterizedBuiltinFEDInstruction to carry over schema and columnNames on FrameBlocks
- Adapted ParameterizedBuiltinFEDInstruction to carry over schema and columnNames on FrameBlocks
- replaced the setColumnMetadata function in FrameBlock with a deep copy variant
- small fix in the FrameColNamesPropagationTest
- added dml file for left Indexing test
- added a readme for the student project
…et-names-on-dataframes

# Conflicts:
#	src/main/java/org/apache/sysds/runtime/controlprogram/caching/FrameObject.java
@t99-i
t99-i marked this pull request as ready for review August 2, 2026 12:46
- removed unused function
@t99-i
t99-i requested a review from janniklinde August 2, 2026 19:09
@janniklinde

Copy link
Copy Markdown
Contributor

Your changes don't build @t99-i. Could you please fix these errors to allow a more detailed evaluation of the code? Thanks.

- added class for SetColumnNamesFunction with helper function for frmabelock handling
@t99-i

t99-i commented Aug 3, 2026

Copy link
Copy Markdown
Author

Your changes don't build @t99-i. Could you please fix these errors to allow a more detailed evaluation of the code? Thanks.

Oh yeah i see it, i forgot to track a file, im really sorry, it should build now

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.99002% with 378 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.64%. Comparing base (af500c8) to head (5cf4c43).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...runtime/instructions/cp/VariableCPInstruction.java 65.11% 76 Missing and 44 partials ⚠️
...rg/apache/sysds/runtime/frame/data/FrameBlock.java 57.08% 35 Missing and 71 partials ⚠️
...rg/apache/sysds/runtime/util/ProgramConverter.java 79.42% 48 Missing and 38 partials ⚠️
...ntime/instructions/spark/ReblockSPInstruction.java 54.54% 11 Missing and 9 partials ⚠️
...ds/runtime/controlprogram/caching/FrameObject.java 74.19% 2 Missing and 6 partials ⚠️
...instructions/cp/BinaryFrameFrameCPInstruction.java 60.00% 5 Missing and 3 partials ⚠️
.../instructions/spark/FrameAppendRSPInstruction.java 87.50% 4 Missing and 2 partials ⚠️
...rg/apache/sysds/runtime/io/FrameReaderTextCSV.java 68.42% 4 Missing and 2 partials ⚠️
...e/instructions/spark/BuiltinNarySPInstruction.java 89.36% 2 Missing and 3 partials ⚠️
...me/instructions/spark/CSVReblockSPInstruction.java 75.00% 0 Missing and 4 partials ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2495      +/-   ##
============================================
+ Coverage     71.61%   71.64%   +0.03%     
- Complexity    50352    50511     +159     
============================================
  Files          1626     1629       +3     
  Lines        194664   195140     +476     
  Branches      38007    38068      +61     
============================================
+ Hits         139408   139814     +406     
- Misses        44328    44382      +54     
- Partials      10928    10944      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants