apache / apache/cloudberry

[Bug] PXF 6.10 doesn't compile with Cloudberry

Open
#983 7 comments 1 reaction 0 assignees View on GitHub
type: Bug
Dominant language
C
Stars
1.4k
Forks
247
Avg merge
4d 3h
Merged PRs (30d)
39

Description

### Apache Cloudberry version

1.6.0 and current `main`

### What happened

Hi, cloudberry team!
I am trying to compile PXF 6.10 (not cloudberry-pxf, as it quite lags behind original PXF v6.4 vs v6.10) for Cloudberry and facing compilation issue:

```
1.430 src/pxfdelimited_formatter.c: In function 'new_pxfdelimited_state':
1.430 src/pxfdelimited_formatter.c:237:76: error: 'FormatterData' has no member named 'fmt_conversion_proc'
1.430 237 | fmt_state->enc_conversion_proc = ((FormatterData*) fcinfo->context)->fmt_conversion_proc;
1.430 | ^~
1.437 make[1]: Leaving directory '/usr/local/pxf_src/external-table'
1.437 make[1]: *** [: src/pxfdelimited_formatter.o] Error 1
```

As I can see this feature was in Greenplum for 10 years
https://github.com/greenplum-db/gpdb-archive/blame/main/src/include/access/formatter.h#L66

And it was removed during "Initial Cloudberry code dump." 10538adb70ac5e81abbe0cb16a9e1cf66ad808ec (with no detailed reasoning available).

Also functions `pg_custom_to_server` and `pg_server_to_custom` marked as `/* Obsolete? */`

I have checked - there is no such file in vanilla postgres (v9.4 and v14.0)

**So, question is**: what is the reason for removing this fields and functions (hope, you have full history of cloudberry).

### What you think should happen instead

_No response_

### How to reproduce

cherry-pick all commits from original PXF to cloudberry-pxf, and trigger build.

following commit will break build:
https://github.com/greenplum-db/pxf-archive/commit/b21768715c7dc73b8598951036d44bb286055ff0#diff-8f1c5b6536bab3ebb1a81b1f2c978599cc995fe59d3fd5c07ed1fb27b5be6f45R237

### Operating System

ubuntu 22.04

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes, I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).

Contributor guide

Open the contributing guide

Research direction

Start with src/pxfdelimited_formatter.c around new_pxfdelimited_state and inspect the FormatterData definition in the formatter.h history. Compare commit 10538adb70ac5e81abbe0cb16a9e1cf66ad808ec with the referenced PXF change and review the obsolete conversion functions. Done means documenting the removal's rationale and identifying the compatibility change required for the PXF build.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.