4 Replies Latest reply on Mar 22, 2013 4:52 AM by gioppoluca

    Getting file remotely

    gioppoluca

      I'm trying to transform a CSV file into a table, but I'd like to get the file from HTTP and not from local file system.

       

      To do this I'm using the WS translator and issuing a invokeHTTP.

      It works but ... since the file is 7800K I think that it gets broken at some point.

       

      This is the transformation

       

      SELECT

              A.WKT_GEOM, A.ST_P_PIA, A.AMBITO, A.PAVIMENTAZIONE, A.POSIZIONE, A.SPECIE, A.ALTEZZA, A.TRONCO, A.ETA

          FROM

              (EXEC alberi.invokeHttp('POST', '', 'http://www.comune.torino.it/aperto/bm~doc/alberate_2011.csv')) AS f, TEXTTABLE(TO_CHARS(f.result, 'UTF-8') COLUMNS WKT_GEOM string, ST_P_PIA string, AMBITO string, PAVIMENTAZIONE string, POSIZIONE string, SPECIE string, ALTEZZA string, TRONCO string, ETA string HEADER) AS A

       

      If I query with SquirrelSQl with 100 limit it works, but if I try to fread all the 60000 rows I get this:

       

      16:00:51,771 WARN  [org.teiid.PROCESSOR] (Worker9_QueryProcessorQueue1003) btHe21eWKWjh TEIID30020 Processing exception 'TEIID30179 java.nio.charset.M

      alformedInputException: Input length = 1' for request btHe21eWKWjh.17.  Exception type org.teiid.core.TeiidProcessingException thrown from java.nio.ch

      arset.CoderResult.throwException(CoderResult.java:260). Enable more detailed logging to see the entire stacktrace.

       

      The funny thing is that if I create a VDB using thre file translator all works well (a bit slow but it works).

      Surely there is something different in the WS translator.

       

      Any hints?

      Thanks

      Luca