TupleEntryIterator iterator = null;
try
{
if( !tap.resourceExists( flowProcess.getConfigCopy() ) )
throw new TapException( "unable to read fields from tap: " + tap + ", does not exist" );
iterator = tap.openForRead( flowProcess );
TupleEntry entry = iterator.hasNext() ? iterator.next() : null;
if( entry == null )
throw new TapException( "unable to read fields from tap: " + tap + ", is empty" );
Object[] result = onlyParseLine( entry.getTuple().getString( 0 ) ); // don't coerce if type info is avail
result = cleanParsedLine( result );
Type[] inferred = inferTypes( result ); // infer type from field name, after removing quotes/escapes
result = cleanFields( result ); // clean field names to remove any meta-data or manage case
sourceFields = new Fields( Arrays.copyOf( result, result.length, Comparable[].class ) );
if( inferred != null )
sourceFields = sourceFields.applyTypes( inferred );
}
catch( IOException exception )
{
throw new TapException( "unable to read fields from tap: " + tap, exception );
}
finally
{
if( iterator != null )
{