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

exec: check for unset output columnTypes #37571

Merged
merged 1 commit into from
May 22, 2019
Merged

exec: check for unset output columnTypes #37571

merged 1 commit into from
May 22, 2019

Conversation

asubiotto
Copy link
Contributor

Future planning PRs need these to be set, so this commit introduces a
check for unset columnTypes that will return an error.

Release note: None

@asubiotto asubiotto requested review from jordanlewis, yuzefovich and a team May 17, 2019 15:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @asubiotto and @jordanlewis)


pkg/sql/distsqlrun/column_exec_setup.go, line 34 at r1 (raw file):

	"github.com/cockroachdb/cockroach/pkg/util/timeutil"
	"github.com/cockroachdb/cockroach/pkg/util/tracing"
	opentracing "github.com/opentracing/opentracing-go"

[nit]: I'm still unsure what our policy is about these "import variables."


pkg/sql/distsqlrun/column_exec_setup.go, line 469 at r1 (raw file):

	if columnTypes == nil {
		return nil, pgerror.Newf(pgerror.CodeDataExceptionError, "output columnTypes unset after planning %T\n", op)

Maybe this should be a panic?

Copy link
Contributor Author

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @yuzefovich)


pkg/sql/distsqlrun/column_exec_setup.go, line 34 at r1 (raw file):

Previously, yuzefovich wrote…

[nit]: I'm still unsure what our policy is about these "import variables."

cc @jordanlewis. Not sure we have a policy about this. This just means (I think) that the directory is called opentracing-go (to differentiate from all the other language implementations) but the go package itself is opentracing. This is a change that goland puts in for me as it sees that it's unnecessary to use an alias. I would prefer not using an alias if it's not necessary.


pkg/sql/distsqlrun/column_exec_setup.go, line 469 at r1 (raw file):

Previously, yuzefovich wrote…

Maybe this should be a panic?

Maybe, it's a good point. However, they were errors in the projection op before though. I would probably lean towards making this a panic.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @asubiotto and @jordanlewis)


pkg/sql/distsqlrun/column_exec_setup.go, line 469 at r1 (raw file):

Previously, asubiotto (Alfonso Subiotto Marqués) wrote…

Maybe, it's a good point. However, they were errors in the projection op before though. I would probably lean towards making this a panic.

My understanding is that we need to set columnTypes all the time, so if they are null, then we should panic as a reminder to set them.

Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @yuzefovich)


pkg/sql/distsqlrun/column_exec_setup.go, line 34 at r1 (raw file):

Previously, asubiotto (Alfonso Subiotto Marqués) wrote…

cc @jordanlewis. Not sure we have a policy about this. This just means (I think) that the directory is called opentracing-go (to differentiate from all the other language implementations) but the go package itself is opentracing. This is a change that goland puts in for me as it sees that it's unnecessary to use an alias. I would prefer not using an alias if it's not necessary.

Not sure but I don't think it matters.


pkg/sql/distsqlrun/column_exec_setup.go, line 469 at r1 (raw file):

Previously, yuzefovich wrote…

My understanding is that we need to set columnTypes all the time, so if they are null, then we should panic as a reminder to set them.

I think this should be a pgerror.NewAssertionErrorf. We don't catch panics here - internal errors are the way to go.

Future planning PRs need these to be set, so this commit introduces a
check for unset columnTypes that will return an error.

Release note: None
Copy link
Contributor Author

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @yuzefovich)


pkg/sql/distsqlrun/column_exec_setup.go, line 469 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

I think this should be a pgerror.NewAssertionErrorf. We don't catch panics here - internal errors are the way to go.

Done.

@craig
Copy link
Contributor

craig bot commented May 22, 2019

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request May 22, 2019
35591: libroach: enable rocksdb WAL recycling r=ajkr a=ajkr

This avoids frequent inode writeback during `fdatasync()` from the
database's third WAL onwards. It helps on filesystems that preallocate
unwritten extents, like XFS and ext4, and also filesystems that don't
support `fallocate()`, like ext2 and ext3.

Release note: None

37571: exec: check for unset output columnTypes r=asubiotto a=asubiotto

Future planning PRs need these to be set, so this commit introduces a
check for unset columnTypes that will return an error.

Release note: None

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
Co-authored-by: Alfonso Subiotto Marqués <alfonso@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented May 22, 2019

Build succeeded

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.

4 participants