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

Skip to content

Conversation

@rivudhk
Copy link
Contributor

@rivudhk rivudhk commented Jan 26, 2026

No description provided.

@rivudhk rivudhk requested review from Copilot and mihaibudiu January 26, 2026 20:18
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 adds comprehensive test coverage for the CAST operator by introducing illegal argument tests that verify both valid and invalid casting operations across different data types.

Changes:

  • Added a new test file with test cases for CAST and SAFE_CAST operations across all data types
  • Imported the new test module in the test suite main file

Reviewed changes

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

File Description
python/tests/runtime_aggtest/illarg_tests/test_cast.py New test file containing 31 test classes that verify CAST operator behavior for legal conversions and expected error cases across all data types (INT, DECIMAL, REAL, DOUBLE, BOOLEAN, VARCHAR, BINARY, TIMESTAMP, DATE, TIME, UUID, ARRAY, MAP, ROW, UDT)
python/tests/runtime_aggtest/illarg_tests/main.py Added import statement to include the new CAST operator tests in the test suite

self.sql = """CREATE MATERIALIZED VIEW cast_timestamp_legal AS SELECT
SAFE_CAST(tmestmp AS INT) AS to_int,
CAST(tmestmp AS DECIMAL) AS to_decimal,
SAFE_CAST(tmestmp AS DECIMAL(6,2)) AS to_decimal,
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 column alias 'to_decimal' is used for two different columns in this query (lines 182 and 183). The second usage should have a distinct name like 'to_decimal0' to match the data structure at line 172.

Suggested change
SAFE_CAST(tmestmp AS DECIMAL(6,2)) AS to_decimal,
SAFE_CAST(tmestmp AS DECIMAL(6,2)) AS to_decimal0,

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I think this needs to be fixed

@rivudhk rivudhk enabled auto-merge January 26, 2026 21:23
@rivudhk rivudhk added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit c5cea4b Jan 26, 2026
1 check passed
@rivudhk rivudhk deleted the illarg_cast branch January 26, 2026 22:27
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.

3 participants