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

HAWQ-927. Pass ProjectionInfo data to PXF #796

Merged
merged 1 commit into from
Jul 20, 2016
Merged

Conversation

kavinderd
Copy link
Contributor

This commit makes the necessary modifications to the HAWQ side of
the codebase to add a list of indices of projected columns

@@ -158,6 +165,29 @@ static void add_tuple_desc_httpheader(CHURL_HEADERS headers, Relation rel)
pfree(formatter.data);
}

static void add_projection_desc_httpheader(CHURL_HEADERS headers, ProjectionInfo *projInfo) {
int i;
char long_number[32];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 32?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we are converting list_length(projInfo->pi_targetlist), we need an array thats 32 chars long to match the bit length of int.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can try something like:
char long_number[(sizeof int) * 8];

@kavinderd
Copy link
Contributor Author

Please review @xunzhang @paul-guo- @huor

@shivzone
Copy link
Contributor

I don't think u need more than 10 bytes for long_number to store a long int.

external_getnext_init(PlanState *state) {
ExternalSelectDesc desc = (ExternalSelectDesc) palloc0(sizeof(ExternalSelectDescData));
if (state != NULL && state->ps_ProjInfo != NULL) {
desc->projInfo = state->ps_ProjInfo;
Copy link
Contributor

@shivzone shivzone Jul 19, 2016

Choose a reason for hiding this comment

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

Second condition is redundant

@xunzhang
Copy link
Member

xunzhang commented Jul 20, 2016

LGTM. Remember rebasing the commits before checking in. 🍺

This commit makes the necessary modifications to the HAWQ side of
the codebase to add a list of indices of projected columns
@shivzone
Copy link
Contributor

+1

@asfgit asfgit merged commit 24d4d96 into apache:master Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants