Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coalesce node support for computed columns #3552

Conversation

sharathbp
Copy link
Contributor

@sharathbp sharathbp commented Mar 5, 2025

Description

We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression. Adding support for Coalesce node types for computed column expressions.

Issues Resolved

babel-5460

Test Scenarios Covered

  • Use case based -
    Yes

  • Boundary conditions -
    Yes

  • Arbitrary inputs -
    Yes

  • Negative test cases -
    Yes

  • Minor version upgrade tests -
    NA

  • Major version upgrade tests -
    NA

  • Performance tests -
    NA

  • Tooling impact -
    NA

  • Client tests -
    NA

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@sharathbp sharathbp requested a review from shalinilohia50 March 5, 2025 05:52
@coveralls
Copy link
Collaborator

coveralls commented Mar 5, 2025

Pull Request Test Coverage Report for Build 13941061821

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 650 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.04%) to 74.995%

Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/pltsql_identity.c 13 93.87%
contrib/babelfishpg_tsql/src/tsql_for/forjson.c 18 90.49%
contrib/babelfishpg_tsql/runtime/functions.c 84 83.67%
contrib/babelfishpg_tsql/src/pl_handler.c 110 90.37%
contrib/babelfishpg_tsql/src/dbcmds.c 199 59.29%
contrib/babelfishpg_tsql/src/hooks.c 226 84.01%
Totals Coverage Status
Change from base Build 13891944935: -0.04%
Covered Lines: 47438
Relevant Lines: 63255

💛 - Coveralls

@shalinilohia50
Copy link
Contributor

There is no SQLValueFunction node handling as the description mentions. Is SQLValueFunction a valid node for Babelfish computed columns or default constraints?

@sharathbp sharathbp changed the title Add coalesce and sql value func node support Add coalesce node support for computed columns Mar 18, 2025
@sharathbp
Copy link
Contributor Author

There is no SQLValueFunction node handling as the description mentions. Is SQLValueFunction a valid node for Babelfish computed columns or default constraints?

SQLValueFunction is not valid node type for Bablefish. I have updated the description.

Copy link
Contributor

@tanscorpio7 tanscorpio7 left a comment

Choose a reason for hiding this comment

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

Do we need DDL export test cases ?

@shardgupta shardgupta merged commit ad1d762 into babelfish-for-postgresql:BABEL_5_X_DEV Mar 19, 2025
47 checks passed
@shardgupta shardgupta deleted the babel-5460-node-support branch March 19, 2025 14:18
sharathbp added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Mar 19, 2025
…sql#3552)

We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression. Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
sharathbp added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Mar 19, 2025
…sql#3552)

We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression. Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
sharathbp added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Mar 19, 2025
…sql#3552)

We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression. Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
sharathbp added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Mar 19, 2025
…sql#3552)

We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression.Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
shardgupta pushed a commit that referenced this pull request Mar 20, 2025
We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression.Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
shardgupta pushed a commit that referenced this pull request Mar 20, 2025
We invoke sys.tsql_get_expr function for getting the column definition in sys.computed_columns. At present tsql_get_expr function doesn't support Coalesce type in computed columns and return null when we try to obtain computed column expression containing Coalesce expression. Adding support for Coalesce node types for computed column expressions.

Task: Babel-5460

Signed-off-by: Sharath BP <[email protected]>
(cherry picked from commit ad1d762)
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.

6 participants