You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2015/06/16 09:29:00 UTC

[jira] [Created] (METAMODEL-153) CSV: "Create table" should not overwrite file when created table name is a new filename

Kasper Sørensen created METAMODEL-153:
-----------------------------------------

             Summary: CSV: "Create table" should not overwrite file when created table name is a new filename
                 Key: METAMODEL-153
                 URL: https://issues.apache.org/jira/browse/METAMODEL-153
             Project: Apache MetaModel
          Issue Type: Improvement
            Reporter: Kasper Sørensen


We are right now adding create table support in the GUI of one of our apps and what I see is that it generally works well, but the CSV module's "create table" support is kinda strange and dangerous.

Because the CsvDataContext can only currently handle 1 file at a time, I guess it was decided that the semantics of "create table" in fact _overwrites_ that file. But on second that that's extremely unfortunate behaviour. I can very easily see users accidentally loosing data that way. And moreover, since in MM 4.x we have made the schema of the CsvDataContext to match the folder name of the CSV file, I think it would make a lot more sense to just create a new file in that folder. Then the schema=folder metaphor would stick and it would be fairly logical to an end user I think.

If a file with that filename already exists, then I would suggest we throw an exception - just like a JDBC database does not allow creating a new table with an existing name.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)