Hi,
You gave me a solution for gzipped files. You also gave me a solution for dealing with delimited text files that don't have the fields in the first row. Now when I try both of these together I get a 'column not found' error.
Here's the error:
-------------
SELECT col1 AS col1_K1, File2.col1 AS col1 FROM (select * from "File2.csv.gz".File2)
jdbc:csv:/samp3,,schemaFile=File2.sql,user=,password=,_CSV_Header=false,_CSV_Separator=,
Inner: java.sql.SQLException: Invalid column: File2.col1
Caused by: java.sql.SQLException: Invalid column: File2.col1
-------------
The SQL works fine when the file is uncompressed. The gzip works fine, when the first row contains the fields. This only happens when I try both at the same time.
Regards,
Mark
The sql looks as follows:
create table if not exists File2(col1 varchar(40),
col2 varchar(40),
col3 varchar(40),
col4 varchar(40),
col5 varchar(40),
col6 INTEGER,
col7 INTEGER,
col8 INTEGER,
col9 INTEGER,
Groups INTEGER
);
|
I guess that you should use:
create table if not exists "File2.csv.gz".File2(col1 varchar(40),
col2 varchar(40),
col3 varchar(40),
col4 varchar(40),
col5 varchar(40),
col6 INTEGER,
col7 INTEGER,
col8 INTEGER,
col9 INTEGER,
Groups INTEGER
);
If failed, please let us know:)
|
That is the solution. I appreciate the quick response.
Regards,
Mark
|
BTW, HXTT CSV can detect your column data type automatical. Without that CREATE TABLE sql,
you will get
column1 varchar(40),
column2 varchar(40),
column3 varchar(40),
column4 varchar(40),
column5 INTEGER,
column6 INTEGER,
column7 INTEGER,
column8 INTEGER,
column9 INTEGER
|