Escape column names in CREATE
Fixes #33 Add test case with a hyphen and an embedded quotation mark
This commit is contained in:
parent
65e47e5828
commit
d3128498b1
Binary file not shown.
|
@ -52,7 +52,16 @@ std::string ParquetTable::CreateStatement() {
|
|||
if(i > 0)
|
||||
text += ", ";
|
||||
|
||||
text += col->name();
|
||||
text += "\"";
|
||||
// Horrifically inefficient, but easy to understand.
|
||||
std::string colName = col->name();
|
||||
for(char& c : colName) {
|
||||
if(c == '"')
|
||||
text += "\"\"";
|
||||
else
|
||||
text += c;
|
||||
}
|
||||
text += "\"";
|
||||
|
||||
std::string type;
|
||||
|
||||
|
|
Loading…
Reference in New Issue