jprante / jdbc-driver-csv

JDBC driver for CSV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preserve case of column name

msteiger opened this issue · comments

Maybe I'm missing something obvious here, but I get column names in upper case no matter what I try.

I'm using this driver in combination with the elasticsearch-jdbc connector to import data in ES. The field names in ES are all upper case. Using a MySQL JDBC driver returns the column names as expected. My query looks like this:

SELECT id as accountId, Name as accountName, Type as accountType FROM account_out

I suspect that this is due to the normalization in ColumnName.

It would be great if the column names could be preserved through the CSV importer.

Column names are per SQL standard case insensitive, so I have to normalize column names somehow.

Maybe this works?

  select COLUMN "Column" ... from ...

Thanks for the hint. However, the query gives me:

java.sql.SQLException: Invalid column name: COLUMN

The inherent problem is that ES uses case-sensitive field names. It seems that some SQL dialects also work with case-sensitive table/column names.

In my opinion, the safest would be to forward column names as-is and just compare them case-insensitively. What do you think?

This functionality has value for us, so I might be able to get time/resources to realize it.
Do you think it makes sense to preserve column names and just compare them case-insensitively?