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

importccl: fix the UX of the IMPORT statement #31263

Open
wants to merge 2 commits into
base: master
from

Conversation

3 participants
@knz
Member

knz commented Oct 11, 2018

This stemmed from user confusion on Gitter.

@knz knz requested a review from dt Oct 11, 2018

@knz knz added this to Triage in SQL Front-end, Lang & Semantics via automation Oct 11, 2018

@knz knz requested a review from mjibson Oct 11, 2018

@knz knz requested review from cockroachdb/sql-bulk-prs as code owners Oct 11, 2018

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 11, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 11, 2018

This change is Reviewable

Show outdated Hide outdated pkg/sql/parser/sql.y Outdated

@knz knz moved this from Triage to Current milestone in SQL Front-end, Lang & Semantics Oct 11, 2018

knz added some commits Oct 11, 2018

sql: clean up the syntax for the IMPORT statement
Prior to this patch, the IMPORT statement grammar didn't match the
contextual help. The main problem is that the datafile must be
enclosed within parentheses when DATA is specified, and only
optionally when DATA is not specified.

This patch cleans up the situation as follows: the presence of the
parentheses is mandated in contextual help and generated syntax
diagrams for all variants of IMPORT.  This choice is made so that a
future CockroachDB version can add more syntax within the
parentheses without ambiguity.

Release note (sql change, enterprise change): The `IMPORT
format file` syntax is deprecated in favor of `IMPORT format
(<file>)`. Similarly, `IMPORT TABLE ... FROM format file` is
deprecated in favor of `IMPORT TABLE ... FROM format (file)`.
@knz

This comment has been minimized.

Show comment
Hide comment
@knz

knz Oct 12, 2018

Member

Fixed, PTAL

Member

knz commented Oct 12, 2018

Fixed, PTAL

@dt

dt approved these changes Oct 12, 2018

I had a slight preference for the no () form being the default for the common case syntaxes, that only take a single file rather than a list.

Before we had the no-() version, when we the early alpha versions of mysql/pg import to pm/customer/etc for beta testing, it was common that they tried it without the (), so it seemed like it was more intuitive without it, and indeed, I find myself preferring it since then as well. I'd rather only doc/show the () version when used in a list of files context.

@knz

This comment has been minimized.

Show comment
Hide comment
@knz

knz Oct 12, 2018

Member

ok I'll do the thing without parentheses before merging

Member

knz commented Oct 12, 2018

ok I'll do the thing without parentheses before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment