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: inverted index backfill can't handle NULL values #38714

Closed
jordanlewis opened this issue Jul 6, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@jordanlewis
Copy link
Member

commented Jul 6, 2019

A forum user found this: https://forum.cockroachlabs.com/t/create-inverted-index-issue/2905/1

root@127.0.0.1:59038/defaultdb> create table a (a json); insert into a values(null);
INSERT 1

Time: 7.085ms

root@127.0.0.1:59038/defaultdb> create inverted index on a(a);
E190706 04:38:39.485769 698 sql/sqltelemetry/report.go:56  [n1,client=127.0.0.1:59040,user=root] encountered internal error:
validation of index a_a_idx failed: expected 0 rows, found 1
E190706 04:38:39.485814 698 sql/sqltelemetry/report.go:56  encountered internal error:
validation of index a_a_idx failed: expected 0 rows, found 1
pq: internal error: validation of index a_a_idx failed: expected 0 rows, found 1
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/backfill.go:987: func1()
github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:166: func1()
github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57: func1()
runtime/asm_amd64.s:1337: goexit()

HINT: You have encountered an unexpected error.

Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.

If you would rather not post publicly, please contact us directly
using the support form.

We appreciate your feedback.

@jordanlewis jordanlewis added this to Triage in Bulk I/O via automation Jul 6, 2019

@lucy-zhang lucy-zhang self-assigned this Jul 8, 2019

craig bot pushed a commit that referenced this issue Jul 8, 2019

Merge #38738
38738: sql: fix inverted index validation on null values r=lucy-zhang a=lucy-zhang

There was a bug where creating inverted indexes would fail at the validation
step for columns containing null values, since we neglected to include nulls
when counting the expected index entries. This PR fixes the builtin function
being used to count expected index entries.

Fixes #38714.

Release note (bug fix): Fix bug that prevented inverted indexes from being
created on JSON columns containing NULL values.

Co-authored-by: Lucy Zhang <lucy-zhang@users.noreply.github.com>

@craig craig bot closed this in #38738 Jul 8, 2019

@dt dt removed this from Triage in Bulk I/O Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.