Open tcm-marcel opened 6 years ago
So, the problem is not when no delimiter is specified, but when no options are provided at all.
COPY customer FROM '/Users/wanshenl/Desktop/data/tpch1/customer.tbl' with (FORMAT csv);
should work (but fail correctly because dbgen
output isn't comma-separated).
Postgres seems to default to CSV if no options are provided, we should probably do the same. Should be a trivial fix.
COPY
got introduced in #1371, including parser changes. Not explicitly specifying a delimiter however crashes Peloton in the parser.Example from @lmwnshn:
postgres=# COPY customer FROM '/Users/wanshenl/Desktop/data/tpch1/customer.tbl';
Peloton output with stack trace
``` 2018-06-12 16:46:27 [src/network/peloton_server.cpp:267:SetupServer] INFO - Listening on port 15721 2018-06-12 16:46:29 [src/network/connection_dispatcher_task.cpp:63:DispatchConnection] DEBUG - Dispatching connection to worker 0 2018-06-12 16:46:29 [src/network/postgres_protocol_handler.cpp:1007:ProcessInitialPacket] INFO - protocol version: 80877103 2018-06-12 16:46:29 [src/network/postgres_protocol_handler.cpp:1007:ProcessInitialPacket] INFO - protocol version: 196608 Process 16764 stopped * thread #12, stop reason = EXC_BAD_ACCESS (code=1, address=0x8) frame #0: 0x000000010188624d libpeloton-d.0.0.5.dylib`peloton::parser::PostgresParser::CopyTransform(root=0x0000625000085098) at postgresparser.cpp:1529 1526 1527 // Handle options 1528 ListCell *cell = nullptr; -> 1529 for_each_cell(cell, root->options->head) { 1530 auto *def_elem = reinterpret_cast