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

Improved CREATE TABLE AS #4760

Closed
jseldess opened this issue May 8, 2019 · 5 comments
Closed

Improved CREATE TABLE AS #4760

jseldess opened this issue May 8, 2019 · 5 comments
Assignees
Labels
P-1 High priority; must be done this release
Milestone

Comments

@jseldess
Copy link
Contributor

jseldess commented May 8, 2019

Background: https://airtable.com/tblD3oZPLJgGhCmch/viwchkdQkRUw6hZ3z/recUoBdXbVnkbBmtl?blocks=hide
PM: @rolandcrosby
Eng:

@jseldess jseldess added C-roadmap P-1 High priority; must be done this release labels May 8, 2019
@jseldess jseldess added this to the 19.2 milestone May 8, 2019
@rolandcrosby
Copy link

Important note to call out in the docs/release notes: CREATE TABLE AS statements will run as jobs in 19.2. This means that they will complete asynchronously and their results will not be immediately available. That change means that transactions like this one, which work in CockroachDB 19.1, will not work in 19.2:

BEGIN TRANSACTION;
CREATE TABLE foo AS (SELECT 1 AS col1);
UPDATE foo SET col1 = 2 * col1 WHERE col1 = 1;
COMMIT TRANSACTION;

I'm not concerned that this will break anyone's workflow -- usage of CREATE TABLE AS is very low, according to our telemetry data, and CREATE TABLE AS currently fails with tables of any meaningful size -- but we do need to call this out as a breaking change.

@lnhsingh
Copy link
Contributor

@lnhsingh
Copy link
Contributor

Important note to call out in the docs/release notes: CREATE TABLE AS statements will run as jobs in 19.2. This means that they will complete asynchronously and their results will not be immediately available. That change means that transactions like this one, which work in CockroachDB 19.1, will not work in 19.2:

BEGIN TRANSACTION;
CREATE TABLE foo AS (SELECT 1 AS col1);
UPDATE foo SET col1 = 2 * col1 WHERE col1 = 1;
COMMIT TRANSACTION;

I'm not concerned that this will break anyone's workflow -- usage of CREATE TABLE AS is very low, according to our telemetry data, and CREATE TABLE AS currently fails with tables of any meaningful size -- but we do need to call this out as a breaking change.

Is this currently true? I ran a CTAS statement and I don't see it in SHOW JOBS. Does the CTAS need to be a certain size for it to be a job?

@lnhsingh
Copy link
Contributor

Note: @ericharmeling made most of the necessary edits about a month ago.

@lnhsingh
Copy link
Contributor

Chatted with @rolandcrosby about this today. No additional docs changes need to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-1 High priority; must be done this release
Projects
None yet
Development

No branches or pull requests

3 participants