Skip to content

support int2vector and oidvector types#2408

Merged
jennifersp merged 9 commits intomainfrom
jennifer/2388
Mar 5, 2026
Merged

support int2vector and oidvector types#2408
jennifersp merged 9 commits intomainfrom
jennifer/2388

Conversation

@jennifersp
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Main PR
covering_index_scan_postgres 579.09/s 559.21/s -3.5%
index_join_postgres 122.98/s 120.44/s -2.1%
index_join_scan_postgres 180.59/s 178.46/s -1.2%
index_scan_postgres 10.86/s 10.66/s -1.9%
oltp_point_select 2360.87/s 2299.68/s -2.6%
oltp_read_only 1682.27/s 1674.48/s -0.5%
select_random_points 109.41/s 107.89/s -1.4%
select_random_ranges 446.21/s 416.23/s -6.8%
table_scan_postgres 10.72/s 10.74/s +0.1%
types_table_scan_postgres 4.96/s 4.93/s -0.7%

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Main PR
Total 42090 42090
Successful 17653 17653
Failures 24437 24437
Partial Successes1 5575 5575
Main PR
Successful 41.9411% 41.9411%
Failures 58.0589% 58.0589%

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@jennifersp jennifersp linked an issue Mar 3, 2026 that may be closed by this pull request
@jennifersp jennifersp changed the title use int16array instead of text type for temp fix for int2vector type support int2vector and oidvector types Mar 3, 2026
@jennifersp jennifersp requested a review from Hydrocharged March 4, 2026 00:10
Copy link
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

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

We definitely need more tests of these types being used in normal tables, so we should add tests to testing/go/types_test.go.

We should also add binary wire compatibility for these types, which is in server/wire_format.go. The accompanying wire format tests are in testing/go/wire_test.go.

Writing wire tests is fairly straightforward as these won't be any different than the majority of the other tests. The setup script just declares and populates a table with the desired types. Then we have two assertions:

  1. Send a Parse message with the query and any name
  2. Send a Describe message for the name given in Parse
  3. Send a Sync message to end the messages

Then Receive should match whatever Postgres returns (I'll go over this at the end). For the second assertion, it's a little different:

  1. Send a Bind message with the same name as earlier. However, we set ResultFormatCodes to 0 to test for the text wire format, and 1 for the binary wire format. There should be two tests to account for the two return types.
  2. Send the Execute message
  3. Send the Close message
  4. Send the Sync message

As before, Receive should contain whatever Postgres returns back. In order to easily get the Postgres values, set the ExternalServerPort field to whatever port your local Postgres instance runs at. You'll need a default Postgres user with the default password of password for it to work. Then you just modify the Receive messages until the tests pass for Postgres, and now you have your ground-truth for what the Doltgres return values should be. According to some external project documents, it looks like both int2vector and oidvector should behave identically to their array counterparts for binary output, but of course this has to be verified with the wire results from Postgres directly (these docs are sometimes wrong since they're not official Postgres docs). Easiest way to achieve that would be to simply pass the value back into writeBinaryWireData except change the type to the array equivalent. Not sure how the array of vectors should work though, so you'll have to reverse engineer that.

@jennifersp jennifersp merged commit abda48f into main Mar 5, 2026
19 of 20 checks passed
@jennifersp jennifersp deleted the jennifer/2388 branch March 5, 2026 22:46
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.

Cannot call unnest on pg_index column indoption.

2 participants