Cockroach: Importing using IMPORT INTO broken when a columns is a reserved keyword

Created on 15 Apr 2020  路  7Comments  路  Source: cockroachdb/cockroach

Describe the problem

It is currently not possible to use IMPORT INTO for importing data into a table which uses a reserved keyword as a column name. reserved keywords

To Reproduce

  1. Set up CockroachDB node
  2. Create a table with a reserved keyword
 create table test ("group" integer, "value" text);
  1. Import the csv example from below using:
root@:26257/kred> IMPORT INTO test ("group", "value") CSV DATA ('nodelocal:///cockroach/csv/test.csv') WITH skip='1';
  1. Observe the following error: pq: verifying target columns: column "\"group\"" does not exist

test.csv:

"group", "value"
1,"test"
2,"test"
3,"test"

Expected behavior
A clear and concise description of what you expected to happen.

Environment:

  • CockroachDB version 19.2.0
  • Server OS: Linux (Ubuntu 18.04)
  • Client app: cockroach sql

Additional context
What was the impact?
I'm trying to convert a non-SQL database into cockroach so the current database is not restricted by using sql reserved keywords, hence certain tables will end up containing reserved keywords. A possible migration of these values will be easier later than prior to importing due to the current database architecture.

C-bug O-community X-blathers-triaged

Most helpful comment

I started it over on https://github.com/cockroachdb/cockroach/pull/47796 but haven't had a chance to dig into the CI flake there yet, but hope to do so tomorrow.

All 7 comments

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I have CC'd a few people who may be able to assist in helping you:

  • @lucy-zhang (found keywords: create table)

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I have assigned a few people who may be able to assist you:

  • @lucy-zhang (found keywords: create table)
  • @dt (found keywords: IMPORT)

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.


Edit: this was an otan test. Welcome to the world of auto-assign :>

I will let Bulk IO take this one.

This is already fixed by #45944 for 20.1, though I guess maybe we should backport that to 19.2.x.

@dt I'm happy to take a stab at it over the weekend but it'd be nice to have it backported for both myself and others that may not want to upgrade to a dev-version yet are still affected by this bug.

I started it over on https://github.com/cockroachdb/cockroach/pull/47796 but haven't had a chance to dig into the CI flake there yet, but hope to do so tomorrow.

47796

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mjibson picture mjibson  路  3Comments

jordanlewis picture jordanlewis  路  4Comments

otan picture otan  路  4Comments

richardanaya picture richardanaya  路  3Comments

magaldima picture magaldima  路  3Comments