BOKJUNSOO opened a new pull request, #4499: URL: https://github.com/apache/arrow-adbc/pull/4499
### Summary When ingesting into an existing PostgreSQL table, the COPY writer selected binary encoders from the Arrow source schema only. Appending an Arrow integer column into an existing `numeric` column therefore sent integer binary COPY bytes that PostgreSQL interpreted as the binary `numeric` layout, producing incorrect values like `0.00` for small integers and other numeric decoding errors for larger values. This updates append/create_append ingestion to resolve the target table column types and pass them into COPY writer selection. For PostgreSQL `numeric` targets, signed and unsigned Arrow integer arrays are now encoded directly in PostgreSQL's binary numeric format. Unsupported source types such as Arrow `double` now fail explicitly instead of sending malformed binary COPY data. I searched for an existing issue in apache/arrow-adbc and did not find one matching this bug. ### Testing - `uvx pre-commit run clang-format --files c/driver/postgresql/statement.h c/driver/postgresql/statement.cc c/driver/postgresql/bind_stream.h c/driver/postgresql/copy/writer.h c/driver/postgresql/postgresql_test.cc` - `uvx pre-commit run cpplint --files c/driver/postgresql/statement.h c/driver/postgresql/statement.cc c/driver/postgresql/bind_stream.h c/driver/postgresql/copy/writer.h c/driver/postgresql/postgresql_test.cc` - `uvx pre-commit run trailing-whitespace --files c/driver/postgresql/statement.h c/driver/postgresql/statement.cc c/driver/postgresql/bind_stream.h c/driver/postgresql/copy/writer.h c/driver/postgresql/postgresql_test.cc` - `uvx pre-commit run end-of-file-fixer --files c/driver/postgresql/statement.h c/driver/postgresql/statement.cc c/driver/postgresql/bind_stream.h c/driver/postgresql/copy/writer.h c/driver/postgresql/postgresql_test.cc` - `uvx pre-commit run codespell --files c/driver/postgresql/statement.h c/driver/postgresql/statement.cc c/driver/postgresql/bind_stream.h c/driver/postgresql/copy/writer.h c/driver/postgresql/postgresql_test.cc` - `git diff --check` - `uvx cmake --build /tmp/arrow-adbc-1.11.0/build-local --target adbc-driver-postgresql-test adbc-driver-postgresql-copy-test -j 8` - `ADBC_POSTGRESQL_TEST_URI='postgresql://postgres:84f7800f4e923af728bc@localhost:9900/postgres?sslmode=disable' /tmp/arrow-adbc-1.11.0/build-local/driver/postgresql/adbc-driver-postgresql-test` (240 passed, 6 skipped) - `ADBC_POSTGRESQL_TEST_URI='postgresql://postgres:84f7800f4e923af728bc@localhost:9900/postgres?sslmode=disable' /tmp/arrow-adbc-1.11.0/build-local/driver/postgresql/adbc-driver-postgresql-copy-test` (73 passed) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
