Package org.apache.pig.backend.local.datastorage

Examples of org.apache.pig.backend.local.datastorage.LocalSeekableInputStream


                ps.println( output );
            }
            ps.close();
           
            PigStorage storage = new PigStorage(":");
            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( is );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
            // Skip till middle of a line
View Full Code Here


                ps.println( output );
            }
            ps.close();
           
            PigStorage storage = new PigStorage(":");
            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( bzis );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
View Full Code Here

                // Add an empty line
                ps.println("");
            }
            ps.close();
           
            LocalSeekableInputStream is = new LocalSeekableInputStream( testFile );
            BufferedPositionedInputStream bpis = new BufferedPositionedInputStream( is );
            PigLineRecordReader reader = new PigLineRecordReader( bpis, 0, Integer.MAX_VALUE );
           
            Text value = new Text();
            int counter = 0;
View Full Code Here

                // Add an empty line
                ps.println("");
            }
            ps.close();

            LocalSeekableInputStream is = new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis = new BufferedPositionedInputStream( bzis );
            PigLineRecordReader reader = new PigLineRecordReader( bpis, 0, Integer.MAX_VALUE );

            Text value = new Text();
View Full Code Here

        cos.close();
        pig.registerQuery("AA=load '" + Util.generateURI(in.getAbsolutePath()) + "';");
        pig.registerQuery("A=foreach (group (filter AA by $0 > 0) all) generate flatten($1);");
        pig.store("A", Util.generateURI(out.getAbsolutePath()));
        CBZip2InputStream cis = new CBZip2InputStream(
                new LocalSeekableInputStream(new File(out, "part-00000.bz")));
        // Just a sanity check, to make sure it was a bzip file; we
        // will do the value verification later
        assertEquals(100, cis.read(new byte[100]));
        cis.close();
        pig.registerQuery("B=load '" + Util.generateURI(out.getAbsolutePath()) + "';");
View Full Code Here

        pig.registerQuery("AA=load '" + Util.generateURI(in.getAbsolutePath()) + "';");
        pig
                .registerQuery("A=foreach (group (filter AA by $0 < '0') all) generate flatten($1);");
        pig.store("A", Util.generateURI(out.getAbsolutePath()));
        CBZip2InputStream cis = new CBZip2InputStream(
                new LocalSeekableInputStream(new File(out, "part-00000.bz")));
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
        pig.registerQuery("B=load '" + Util.generateURI(out.getAbsolutePath()) + "';");
        pig.openIterator("B");
        in.delete();
View Full Code Here

        CBZip2OutputStream cos = new CBZip2OutputStream(new FileOutputStream(
                tmp));
        cos.close();
        assertNotSame(0, tmp.length());
        CBZip2InputStream cis = new CBZip2InputStream(
                new LocalSeekableInputStream(tmp));
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
        tmp.delete();

    }
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.local.datastorage.LocalSeekableInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.