Skip to content

binary: support multidimensional arrays#233

Open
serprex wants to merge 2 commits intomainfrom
multidimensonal-arrays
Open

binary: support multidimensional arrays#233
serprex wants to merge 2 commits intomainfrom
multidimensonal-arrays

Conversation

@serprex
Copy link
Copy Markdown
Member

@serprex serprex commented May 7, 2026

needed for functions like extractAllGroupsHorizontal returning Array(Array(String))

@serprex serprex requested a review from theory May 7, 2026 18:55
@serprex serprex changed the title support multidimensional arrays binary: support multidimensional arrays May 7, 2026
Comment thread src/convert.c
Comment on lines +269 to +270
* Jagged shape: format as text and route through array_in so
* binary surfaces the same malformed-literal error as http.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this might be overkill, other option is to just raise error that array is jagged

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Love consistent error messages!

@theory theory added data types Improve data type support drivers Improve binary and/or http driver support labels May 7, 2026
@serprex serprex force-pushed the multidimensonal-arrays branch 3 times, most recently from 9cf1c6a to 075ca77 Compare May 7, 2026 23:53
Copy link
Copy Markdown
Collaborator

@theory theory left a comment

Choose a reason for hiding this comment

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

Great, but I think there are some leftovers, like this in convert.c starting at line 637:

				if (AARR_NDIM(v) > 1)
					ereport(ERROR,
							(errcode(ERRCODE_DATATYPE_MISMATCH),
							 errmsg("pg_clickhouse: inserted array should have one dimension")));

And this in deparse.c at line 2086:

	if (ndims > 1)
		ereport(ERROR,
				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
				 errmsg("only one dimension of arrays supported by pg_clickhouse")));

I presume these are no longer relevant, yes?

Also: Please note improvement in CHANGELOG.md.

Comment thread src/convert.c
Comment on lines +269 to +270
* Jagged shape: format as text and route through array_in so
* binary surfaces the same malformed-literal error as http.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Love consistent error messages!

@serprex
Copy link
Copy Markdown
Member Author

serprex commented May 8, 2026

those checks were still relevant because INSERT didn't support multi-dimensional. updated PR to support that

@serprex serprex requested a review from theory May 8, 2026 16:21
@serprex serprex force-pushed the multidimensonal-arrays branch from cbdafed to 8d9a7f8 Compare May 8, 2026 16:29
serprex added 2 commits May 9, 2026 05:03
needed for functions like extractAllGroupsHorizontal returning Array(Array(String))
@serprex serprex force-pushed the multidimensonal-arrays branch from 8d9a7f8 to dbf407d Compare May 9, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data types Improve data type support drivers Improve binary and/or http driver support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants