Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.SimpleTupleMetadata


    public void testSimple() throws Exception
    {
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        columns.add(new SimpleColumnMetadata("A", TupleTypes._INT, 0, 0, 0));
        columns.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe dataInput = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(0, 1)),
                new SimpleTuple(Arrays.asList(2, 3)),
View Full Code Here


    public void testReplaceNulls() throws Exception
    {
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        columns.add(new SimpleColumnMetadata("A", TupleTypes._INT, 0, 0, 0));
        columns.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe dataInput = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(Null.VALUE, "a")),
                new SimpleTuple(Arrays.asList(0, "b")),
View Full Code Here

            else
            {
                column = new SimpleColumnMetadata("class", TupleTypes._STRING, 0, 0, 0);
            }
           
            TupleMetadata outMetadata = new SimpleTupleMetadata(Collections.singletonList(column));
            mOutput.write(new MetadataWrapper(outMetadata));
            Tuple tuple;
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
               
View Full Code Here

    @Test
    public void testSimple() throws Exception
    {
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        columns.add(new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0));
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        MockInputPipe data1Input = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList("Rupert")),
                new SimpleTuple(Arrays.asList("Ally")),
View Full Code Here

       
        MockInputPipe inputSize = new MockInputPipe(2);
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        Tuple tuple4 = new SimpleTuple(Arrays.<Object>asList("Adrian", 3.0));
        Tuple tuple5 = new SimpleTuple(Arrays.<Object>asList("Rob", 4.0));
View Full Code Here

       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
View Full Code Here

    {
       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
View Full Code Here

        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        for (int i=0; i<mModifiers.length; i++)
        {
            columns.add(mModifiers[i].getColumnMetadata());
        }
        TupleMetadata md = new SimpleTupleMetadata(columns);
        return new MetadataWrapper(md);
    }
View Full Code Here

                        0,
                        ColumnMetadata.COLUMN_NULLABLE,
                        0);
            cols.add(column);
        }
        TupleMetadata result = new SimpleTupleMetadata(cols);
        return result;
    }
View Full Code Here

    private MetadataWrapper createTupleMetadata()
    {
        List<ColumnMetadata> cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._INT, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
        return new MetadataWrapper(metadata);
    }
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.tuple.SimpleTupleMetadata

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.