Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: add proper telemetry for arrays of JSON #35704

Merged
merged 1 commit into from
Mar 14, 2019

Conversation

knz
Copy link
Contributor

@knz knz commented Mar 13, 2019

Arrays of JSON are not supported but the errors did not
link attempted uses to issue #23468. This patch fixes it.

@knz knz requested review from justinj and RaduBerinde March 13, 2019 21:49
@knz knz requested a review from a team as a code owner March 13, 2019 21:49
@knz knz requested a review from a team March 13, 2019 21:49
@knz knz requested a review from a team as a code owner March 13, 2019 21:49
@knz knz requested review from a team March 13, 2019 21:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz force-pushed the 20190313-json-arrays branch 2 times, most recently from 2f9e021 to c04ff44 Compare March 14, 2019 00:02
Copy link
Contributor

@justinj justinj left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @justinj, @knz, and @RaduBerinde)


pkg/sql/coltypes/arrays.go, line 52 at r1 (raw file):

// canBeInArrayColType returns true if the given T is a valid
// element type for an array column type.

I think the issueNum, while fairly self-explanatory, could be mentioned in this comment.

Arrays of JSON are not supported but the errors did not
link attempted uses to issue cockroachdb#23468. This patch fixes it.

Release note: None
@knz knz force-pushed the 20190313-json-arrays branch from c04ff44 to f01a4ba Compare March 14, 2019 09:33
@knz
Copy link
Contributor Author

knz commented Mar 14, 2019

I think the issueNum, while fairly self-explanatory, could be mentioned in this comment.

Good idea! Done.

@knz
Copy link
Contributor Author

knz commented Mar 14, 2019

TFYR!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 14, 2019

Build failed

@knz
Copy link
Contributor Author

knz commented Mar 14, 2019

failed on #35549

craig bot pushed a commit that referenced this pull request Mar 14, 2019
35714: sql,opt: enrich the reported errors, avoid "naked" panics r=knz a=knz

First commit from  #35704.
Informs https://github.com/cockroachlabs/registration/issues/203.

The `optbuilder` package's error handling was deficient in two ways:

- it would fail assertions with a hard panic and cause a node
  shutdown;
- it did not enrich errors with a suitable pg error code in many
  cases, including missing references to issues that track
  unimplemented features.

This patch fixes the former by introducing a new primitive
`assertionErrorf` that creates a pgerror with CodeInternalError (this
is picked up in telemetry automatically).

It fixes the latter by adding the missing error codes.  Where
applicable, errors have been either picked from the HP code, or from
PostgreSQL. In the latter cases the code was also backported to the HP
for consistency.

Additionally, a linter is added to prevent the addition of new
undecorated panics.

Release note: None

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig craig bot merged commit f01a4ba into cockroachdb:master Mar 14, 2019
@knz knz deleted the 20190313-json-arrays branch March 14, 2019 10:39
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.

3 participants