wl21st / jaql

Automatically exported from code.google.com/p/jaql
0 stars 0 forks source link

Error when using output stream #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

localRead('/home/user/foo',
{format: 'com.acme.extensions.data.FromJSONTxtConverter'}) 

works for reading but 

localWrite('/home/user/bar.json', 
{format: 'com.acme.extensions.data.ToJSONTxtConverter'},$blah); 

does not work for writing. 

java.lang.Exception: formatter must implement ItemOutputStream
java.lang.Exception: formatter must implement ItemOutputStream
        at com.ibm.jaql.io.stream.StreamOutputAdapter.initializeFrom
(StreamOutputAdapter.java:57)
        at com.ibm.jaql.io.AbstractOutputAdapter.initializeFrom
(AbstractOutputAdapter.java:48)
        at com.ibm.jaql.io.AdapterStore$OptionHandler.getAdapter
(AdapterStore.java:305)
        at com.ibm.jaql.lang.expr.io.StWriteExpr.eval(StWriteExpr.java:129)
        at com.ibm.jaql.lang.expr.top.QueryExpr.eval(QueryExpr.java:92)
        at com.ibm.jaql.lang.Jaql.main1(Jaql.java:86)
        at JaqlShell.runInteractively(JaqlShell.java:173)
        at JaqlShell.main(JaqlShell.java:378)

Original issue reported on code.google.com by vuk.erce...@gmail.com on 26 Jan 2009 at 6:42

GoogleCodeExporter commented 9 years ago
These should use converters: 
com.ibm.jaql.io.hadoop.converter.FromJsonTextConverter and ToJsonTextConverter. 
Note that for the latter, you must also specify a configurator, e.g., ... -> 
write(hdfs('jaqlTest/test17out.dat', 
              {converter: 'com.ibm.jaql.io.hadoop.converter.ToJsonTextConverter', 
               configurator: 'com.ibm.jaql.io.hadoop.TextFileOutputConfigurator'}));

Original comment by vuk.erce...@gmail.com on 25 Sep 2010 at 6:28