gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

disallow generated columns in distribution key

Open yanwr1 opened this issue 3 years ago • 2 comments

The generated columns are computed after distribution. if generated columns are used as distribution key, they will always use null values to compute the distribution key value, and it will cause wrong query results.

Here are some reminders before you submit the pull request

  • [ ] Add tests for the change
  • [ ] Document changes
  • [ ] Communicate in the mailing list if needed
  • [ ] Pass make installcheck
  • [ ] Review a PR in return to support the community

yanwr1 avatar Aug 03 '22 16:08 yanwr1

I am looking into this. Thanks for the PR.

kainwen avatar Aug 10 '22 03:08 kainwen

Overall LGTM. Some comments:

  1. please add comments in code also
  2. please address review before pushing
  3. do you try what if generated column as partition keys? (What is Postgres's behavior, and GPDB's)

Thanks.

generated columns can't be in partition keys both in postgres and GPDB.

yanwr1 avatar Aug 10 '22 06:08 yanwr1