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 function to sync metadata to CitusDB #56
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Performs an on-demand sync from pg_shard's metadata to that of Citus.
Now the only C function remaining returns the Var representation of the partition column.
Also converted the C function to use an Oid, thus allowing us to keep ResolveRelationId unchanged.
Add object file to targets.
We won't call it this way, but just in case.
|
||
/* declarations for dynamic loading */ | ||
PG_FUNCTION_INFO_V1(partition_column_to_node_string); | ||
Datum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add spacing between the declaration, and also more importantly add a function comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
We use tabs, so switched to those. Also added NOT NULL and CONSTANT modifiers to make variable declaration more explicit. Finally, added function comments, which will display when users ask for descriptions of functions.
Tests nodeToString internal UDF as well as the user-facing sync UDF.
Forgot this one.
jasonmp85
force-pushed
the
feature-citus_integration-#26
branch
from
January 20, 2015 02:01
59b6d9b
to
f013b29
Compare
Feedback from IWYU.
jasonmp85
added a commit
that referenced
this pull request
Jan 20, 2015
Add function to sync metadata to CitusDB cr: @sumedhpathak
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I went back and forth as to whether this should be included with
pg_shard
proper or implemented in a separate extension but ultimately decided the former would be too complicated. Besides, we already have a GUC for CitusDB-related behavior so this isn't setting a new precedent re: encapsulation or anything.I investigated whether making the C function entirely independently of the rest of the code was worthwhile, but as this is all in one extension that seemed a bit extreme. Another avenue I pursued was moving the longer PL/pgSQL function out to its own file. This blog post gave me some ideas, but I think they're not worth implementing at the moment.
So I cleaned up whitespace, added function comments, added
UPSERT
-like logic, and ensured we handledNULL
inputs at all points in the call chain. I'm writing the rest of my unit tests now and will push them up shortly.fixes #26.