Skip to content

feat(c/driver/postgresql): add POSTGRESQL:type metadata - #4687

Open
lidavidm wants to merge 3 commits into
apache:mainfrom
lidavidm:gh-4461
Open

feat(c/driver/postgresql): add POSTGRESQL:type metadata#4687
lidavidm wants to merge 3 commits into
apache:mainfrom
lidavidm:gh-4461

Conversation

@lidavidm

Copy link
Copy Markdown
Member

Closes #4461.

Assisted-by: GPT-5.6 Sol codex@openai.com

Closes apache#4461.

Assisted-by: GPT-5.6 Sol <codex@openai.com>
@lidavidm
lidavidm marked this pull request as ready for review August 17, 2026 01:52
@lidavidm
lidavidm requested a balanced review from Copilot August 17, 2026 01:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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));

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 75 out of 75 changed files in this pull request and generated 1 comment.

Comment thread c/driver/postgresql/result_reader.cc Outdated
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
lidavidm marked this pull request as draft August 17, 2026 08:34
@lidavidm
lidavidm marked this pull request as ready for review August 18, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

c/driver/postgresql: include POSTGRESQL:type metadata on result schema

2 participants