Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mihaibudiu
Copy link
Contributor

Fixes #5390

This affects how the hash of a structure name is computed; this change makes it possible to distinguish between anonymous and named structs that are otherwise identical, which occur in the example program.

@mihaibudiu mihaibudiu requested review from Copilot and rivudhk January 26, 2026 22:26
@mihaibudiu mihaibudiu enabled auto-merge January 26, 2026 22:27
Copy link
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

This PR fixes issue #5390 by modifying how struct types generate their string representation to include the hash value. This change enables the compiler to distinguish between anonymous and named structs with identical field structures, which was causing conflicts in the reported issue.

Changes:

  • Modified DBSPTypeStruct.toString() to append the hash value to the struct name output
  • Added test case issue5390() that creates user-defined types with similar structures (one using anonymous ROW, one using named user-defined type) to verify the fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sql-to-dbsp-compiler/SQL-compiler/src/test/java/org/dbsp/sqlCompiler/compiler/sql/CatalogTests.java Adds regression test for issue #5390 with user-defined types containing similar nested structures
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/ir/type/derived/DBSPTypeStruct.java Updates struct string representation to include hash value for proper differentiation

Comment on lines +286 to +289
.append(" ")
.append(this.name.name())
.append(" ")
.append(this.hashName);
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The addition of spaces around the struct name and hash creates output like struct name hash. This spacing pattern may not match the expected format. Consider removing the extra spaces or documenting why this specific spacing is required.

Copilot uses AI. Check for mistakes.
@mihaibudiu mihaibudiu added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit 7ef02de Jan 27, 2026
6 of 7 checks passed
@mihaibudiu mihaibudiu deleted the issue5390 branch January 27, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SQL] SAFE_CAST(NULL AS USER DEFINED type) passes SQL but fails Rust compilation

3 participants