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

GROUP BY error when setting compress_segmentby with an enum column #4619

Closed
wants to merge 5 commits into from

Conversation

sb230132
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #4619 (225d137) into main (03defb3) will decrease coverage by 0.00%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4619      +/-   ##
==========================================
- Coverage   90.77%   90.76%   -0.01%     
==========================================
  Files         224      224              
  Lines       41857    41975     +118     
==========================================
+ Hits        37994    38098     +104     
- Misses       3863     3877      +14     
Impacted Files Coverage Δ
tsl/src/nodes/decompress_chunk/decompress_chunk.c 95.20% <80.00%> (-0.14%) ⬇️
src/telemetry/functions.c 91.33% <0.00%> (-2.98%) ⬇️
src/cross_module_fn.c 67.87% <0.00%> (-2.57%) ⬇️
tsl/src/nodes/data_node_dispatch.c 96.49% <0.00%> (-0.24%) ⬇️
src/time_bucket.c 98.25% <0.00%> (-0.16%) ⬇️
tsl/src/bgw_policy/policies_v2.c 96.27% <0.00%> (-0.12%) ⬇️
tsl/src/bgw_policy/job.c 88.62% <0.00%> (-0.05%) ⬇️
src/chunk.c 94.50% <0.00%> (-0.04%) ⬇️
tsl/src/remote/dist_ddl.c 95.82% <0.00%> (-0.02%) ⬇️
src/chunk.h 100.00% <0.00%> (ø)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c5a759...225d137. Read the comment docs.

@sb230132 sb230132 marked this pull request as ready for review August 16, 2022 11:41
Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

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

You should not change the vartype of the Var but instead fall back to anyenum lookup for the operators when the type is an enum and the lookup with the explicit type fails.

fix Outdated Show resolved Hide resolved
Comment on lines 231 to 233
if (has_null_input)
{
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (has_null_input)
{
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by removing the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you forgot to remove it, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, i had this change in my main branch. Thus this change was re-appearing again and again. Reverted this change in main branch and fixed in current branch as well.

@fabriziomello
Copy link
Contributor

Some comments:

  1. You need provide a better commit message describing what is the problem you're solving and how you fixed it (for example Fix assertion in GRANT .. ON ALL TABLES IN SCHEMA #4582)
  2. Remember squash commits before rebase it to the main branch, unless you really want to send several commits, and for that each one should have a good description and also use the Disable-check: commit-count in the PR description to silent the CI
  3. Add to the thanks section in CHANGELOG the issue reporter

@sb230132 sb230132 force-pushed the group-by-PR branch 5 times, most recently from 9c24007 to ba9950c Compare August 17, 2022 14:06
Comment on lines 224 to 227
else
{
elog(ERROR, "Invalid segmentby column");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this branch? If yes shouldn't have a test case for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree that its good to have a testcase. However iam not sure what test will hit this code.
I think it's better to have this code, so that it may hit in future. If we remove this, then code may further execute and report some unknown error or even worse case crash or return wrong results.

@fabriziomello
Copy link
Contributor

Seems your code editor messed (automatically formatted) the CHANGELOG.md... we prefer to send coding format changes into a separated PR because it make useless the git blame. Check the .git-blame-ignore-revs in the root of source three.

Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

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

I think we need to have similar check when we enable compression for the hypertable. No point having a compressed hypertable that errors when you try to query it.

}
else
{
elog(ERROR, "Invalid segmentby column");
Copy link
Member

Choose a reason for hiding this comment

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

This does not conform to pg error message style guide: https://www.postgresql.org/docs/current/error-style-guide.html
Should probably be more along the lines of sort operator lookup failed for column "%s"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed as per your suggestion.

@sb230132
Copy link
Contributor Author

Seems your code editor messed (automatically formatted) the CHANGELOG.md... we prefer to send coding format changes into a separated PR because it make useless the git blame. Check the .git-blame-ignore-revs in the root of source three.

Right, its my editor which screwed up the formatting. Fixed now.

@sb230132
Copy link
Contributor Author

I think we need to have similar check when we enable compression for the hypertable. No point having a compressed hypertable that errors when you try to query it.

May be yes. But i dont have all the context required to check for these conditions during ALTER TABLE ... ENABLE COMPRESSION.

}
else
{
elog(ERROR, "Sort operator lookup failed for column \"%s\"", column_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
elog(ERROR, "Sort operator lookup failed for column \"%s\"", column_name);
elog(ERROR, "sort operator lookup failed for column \"%s\"", column_name);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Revert "Build error"

This reverts commit e841fed.

Fixed formatting in error message.

Addressed review comments.

Fixed formatting of CHANGELOG.md file.

Addressed review comments.

Updated error message as per Sven suggestion.
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Sven Klemm <31455525+svenklemm@users.noreply.github.com>
Copy link
Contributor Author

@sb230132 sb230132 left a comment

Choose a reason for hiding this comment

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

Fixed Sven comment.

@sb230132 sb230132 closed this Aug 29, 2022
@sb230132 sb230132 deleted the group-by-PR branch August 29, 2022 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants