Skip to main content

Where does fcsvparser send error messages ?

  • January 5, 2016
  • 2 replies
  • 13 views

Pieter_Sheth-Vo
Forum|alt.badge.img+2

Where does fcsvparser send error messages ?  AIso, is there an equivalent of `ABORT ON ERROR` for `fcsvparser`?  

 

COPY myschema.mytable FROM STDIN DELIMITER ',' PARSER fcsvparser(reject_on_materialized_type_error='true');

 

2 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • January 7, 2016

Hi,

 

    DId you create your own parser named fcsvparser??

 

 

Sruthi


Pieter_Sheth-Vo
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • January 7, 2016

Actually fcsvparser() comes standard with Vertica 7.  I had started modifying the Rfc4180CSVParser.cpp example to enable options like headers and error messages, then discovered that before getting too deep.

 

 

It's designed for Flex Tables (presumably why it starts with "f") but it actually works with any table.  It has lots of options, including how to handle the header and rejected data.   

 

Subsequent to posting this thread, I found this doc (http://my.vertica.com/docs/7.2.x/HTML/Content/Authoring/FlexTables/LoadCSVData.htm) which shows it also can use the COPY command options "REJECTED DATA AS" to send results to a file or table.  

 

COPY foo_1 FROM STDIN PARSER fcsvparser(reject_on_materialized_type_error=true) 
rejected data as table "m";

 

Still have a possibly minor obstacle left to get this working.    The rejected data table is created (yay) but always seems empty even when bad data is encountered.  

 

https://gist.github.com/protobi/62b225b448db39c33af5