Skip to content

Conversation

@khustup2
Copy link
Contributor

@khustup2 khustup2 commented Jan 7, 2026

🚀 🚀 Pull Request

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Things to be aware of

Things to worry about

Additional Context

Copilot AI review requested due to automatic review settings January 7, 2026 19:54
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

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 a bug where UPDATE operations on tables with UUID columns containing NULL values would fail with "invalid value for type uuid" errors. The fix ensures that empty strings from the underlying storage are correctly interpreted as NULL values for UUID columns during UPDATE operations.

Key Changes:

  • Added empty string handling for UUID columns in table scan and array-to-datum conversion functions
  • Added comprehensive test coverage for UUID NULL handling in UPDATE operations

Reviewed changes

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

File Description
postgres/tests/py_tests/test_uuid_null_update_bug.py New test file validating UUID NULL handling in UPDATE operations across various scenarios
cpp/deeplake_pg/table_scan_impl.hpp Added empty string check to treat empty UUIDs as NULL in table scans
cpp/deeplake_pg/nd_utils.hpp Added empty string check to treat empty UUIDs as NULL in array-to-datum conversions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +665 to +669
// Treat empty string as NULL for UUID columns (same as duckdb_deeplake_scan.cpp)
if (str.empty()) {
// Return NULL datum - caller must set is_null flag appropriately
return (Datum)0;
}
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The function returns a NULL datum but relies on the caller to set the is_null flag appropriately. This creates an ambiguous return value where (Datum)0 could represent either NULL or a valid zero datum. Consider returning a std::pair<Datum, bool> similar to table_scan::get_datum to explicitly communicate the null status, or document the expected caller behavior more clearly in the function signature.

Copilot uses AI. Check for mistakes.
@khustup2 khustup2 merged commit e2bffb3 into main Jan 7, 2026
6 checks passed
@khustup2 khustup2 deleted the uuid-fix branch January 7, 2026 20:46
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.

2 participants