Bug 6692 - import with COPY INTO and missing column list for csv file has an unclear error message.
Summary: import with COPY INTO and missing column list for csv file has an unclear err...
Status: NEW
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: 11.31.13 (Aug2018-SP2)
Hardware: Other Linux
: Normal normal
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-18 10:46 CET by aris
Modified: 2019-03-18 10:46 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aris 2019-03-18 10:46:51 CET
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier: 

Say we want to import values from a csv file into a subset of the columns of some table. The user can use undocumented syntax involving column lists to specify where to import what.

However the syntax is a bit verbose and could be improved with some better default behaviour and/or better error handling. Plus there should be an entry in the documentation that specifies how this work because it is a very useful feature to exhibit.



Reproducible: Always

Steps to Reproduce:
1.create table foo (k int auto_increment, i int, s string);
2.copy into foo (i, s) from '/home/aris/Sources/monetdb/sql/test/bugs/Tests/test.csv' delimiters ',', '\n', '''';
3.
Actual Results:  
Failed to import table 'foo', Column value 2 missing

Expected Results:  
2 affected rows --success!
--Use the same column list as specified for the table as a default for the column list associated to the csv file.
--or
Missing mandatory column list associated to csv file.
--or some better message than this


Please also update documentation.