feat(c/driver/postgresql): add POSTGRESQL:type metadata - #4687
Open
lidavidm wants to merge 3 commits into
Open
Conversation
Closes apache#4461. Assisted-by: GPT-5.6 Sol <codex@openai.com>
There was a problem hiding this comment.
Pull request overview
Adds POSTGRESQL:type metadata to PostgreSQL result-schema fields and enables validation coverage.
Changes:
- Adds PostgreSQL type-name field metadata during schema construction.
- Extends and consolidates type validation fixtures.
- Updates documented schema output.
Reviewed changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
docs/source/python/recipe/postgresql_execute_nocopy.py.stdout.txt |
Updates captured schema output. |
docs/source/python/recipe/postgresql_execute_nocopy.py |
Documents field metadata. |
c/driver/postgresql/validation/tests/postgresql.py |
Enables type metadata validation. |
c/driver/postgresql/validation/queries/type/select/uuid.txtcase |
Normalizes expected type name. |
c/driver/postgresql/validation/queries/type/select/timestamptz.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/select/timestamp.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/select/time.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/select/string.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/select/string.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/select/jsonb.txtcase |
Normalizes expected type name. |
c/driver/postgresql/validation/queries/type/select/json.txtcase |
Normalizes expected type name. |
c/driver/postgresql/validation/queries/type/select/int64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/select/int32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/select/int16.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/select/float64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/select/float32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/select/decimal.txtcase |
Adds metadata and inline schema. |
c/driver/postgresql/validation/queries/type/select/decimal.schema.json |
Removes inlined schema fixture. |
c/driver/postgresql/validation/queries/type/select/date.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/select/boolean.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/select/binary.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/select/binary.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/literal/uuid.txtcase |
Normalizes expected type name. |
c/driver/postgresql/validation/queries/type/literal/timestamptz.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/timestamp.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/time.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/string.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/int64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/literal/int32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/literal/int16.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/literal/float64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/literal/float32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/literal/decimal.txtcase |
Adds metadata and inline schema. |
c/driver/postgresql/validation/queries/type/literal/decimal.schema.json |
Removes inlined schema fixture. |
c/driver/postgresql/validation/queries/type/literal/date.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/boolean.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/literal/binary.txtcase |
Adds metadata and inline query. |
c/driver/postgresql/validation/queries/type/literal/binary.sql |
Removes inlined query fixture. |
c/driver/postgresql/validation/queries/type/bind/uuid.txtcase |
Normalizes expected type name. |
c/driver/postgresql/validation/queries/type/bind/timestamptz_us.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamptz_s.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamptz_ns.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamptz_ms.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamp_us.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamp_s.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamp_ns.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/timestamp_ms.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/time_us.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/string.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/string.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/string_view.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/string_view.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/large_string.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/large_string.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/large_binary.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/large_binary.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/int64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/int32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/int16.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/float64.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/float32.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/float16.txtcase |
Adds SQL and field type names. |
c/driver/postgresql/validation/queries/type/bind/fixed_size_binary.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/fixed_size_binary.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/decimal.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/date.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/boolean.txtcase |
Adds type metadata expectation. |
c/driver/postgresql/validation/queries/type/bind/binary.txtcase |
Adds metadata and inline SQL. |
c/driver/postgresql/validation/queries/type/bind/binary.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/validation/queries/type/bind/binary.bind.sql |
Removes inlined bind fixture. |
c/driver/postgresql/validation/queries/type/bind/binary_view.txtcase |
Adds metadata and inline setup. |
c/driver/postgresql/validation/queries/type/bind/binary_view.setup.sql |
Removes inlined setup fixture. |
c/driver/postgresql/postgres_type.h |
Adds schema field type metadata. |
c/driver/postgresql/postgres_type_test.cc |
Tests metadata values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+357
to
+359
| // Don't add POSTGRESQL:type to top-level field (which is the schema) | ||
| if (type_id_ != PostgresTypeId::kRecord || !field_name_.empty()) { | ||
| NANOARROW_RETURN_NOT_OK(AddTypeMetadata(schema)); |
Comment on lines
+206
to
+208
| UNWRAP_ERRNO(Internal, | ||
| ArrowSchemaSetName(schema_->children[i], helper_.FieldName(i))); | ||
| UNWRAP_ERRNO(Internal, child_type.SetSchema(schema_->children[i], vendor_name_)); |
lidavidm
marked this pull request as draft
August 17, 2026 08:34
lidavidm
marked this pull request as ready for review
August 18, 2026 00:37
This file contains hidden or 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
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.
Closes #4461.
Assisted-by: GPT-5.6 Sol codex@openai.com