diff --git a/parquet-generator/weird-column-names.parquet b/parquet-generator/weird-column-names.parquet new file mode 100644 index 0000000..af44ee2 Binary files /dev/null and b/parquet-generator/weird-column-names.parquet differ diff --git a/parquet/parquet_table.cc b/parquet/parquet_table.cc index a0ede14..d796b8a 100644 --- a/parquet/parquet_table.cc +++ b/parquet/parquet_table.cc @@ -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;