Examples of SimpleColumnMetadata


Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }
   
    public void testSimple() throws Exception
    {
        List<ColumnMetadata> cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
        MockInputPipe inputTuples = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, "A"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, "B"})),
                new SimpleTuple(Arrays.asList(new Object[] {3, "C"})),
                ControlBlock.LIST_END
        });
        activity.addInput("data", inputTuples);
       
        cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._ODNULL, 0, 0, 11));
        metadata = new SimpleTupleMetadata(cdlist);
        MockInputPipe inputValues = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {0, Null.getValue()})),
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }

    public void testNoColumns() throws Exception
    {
        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));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
        MockInputPipe inputTuples = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, 2, "A"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, 3, "B"})),
                new SimpleTuple(Arrays.asList(new Object[] {3, 4, "C"})),
                ControlBlock.LIST_END
        });
        activity.addInput("data", inputTuples);
       
        cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        metadata = new SimpleTupleMetadata(cdlist);
        MockInputPipe inputValues = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }

    public void testNoValues() throws Exception
    {
        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));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
        MockInputPipe inputTuples = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, 2, "A"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, 3, "B"})),
                new SimpleTuple(Arrays.asList(new Object[] {3, 4, "C"})),
                ControlBlock.LIST_END
        });
        activity.addInput("data", inputTuples);
       
        cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        metadata = new SimpleTupleMetadata(cdlist);
        MockInputPipe inputValues = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                ControlBlock.LIST_END
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }

    public void testTooManyValues() throws Exception
    {
        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));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
        MockInputPipe inputTuples = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, 2, "A"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, 3, "B"})),
                new SimpleTuple(Arrays.asList(new Object[] {3, 4, "C"})),
                ControlBlock.LIST_END
        });
        activity.addInput("data", inputTuples);
       
        cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        metadata = new SimpleTupleMetadata(cdlist);
        MockInputPipe inputValues = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, 2, 3} )),
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }
   
    public void testWrongValueSize() throws Exception
    {
        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));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
        MockInputPipe inputTuples = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, 2, "A"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, 3, "B"})),
                new SimpleTuple(Arrays.asList(new Object[] {3, 4, "C"})),
                ControlBlock.LIST_END
        });
        activity.addInput("data", inputTuples);
       
        cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
        metadata = new SimpleTupleMetadata(cdlist);
        MockInputPipe inputValues = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1} )),
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    public void testProcess() throws Exception
    {
        StatisticsActivity activity = new StatisticsActivity();
       
        List<Object> columns = new ArrayList<Object>();
        SimpleColumnMetadata col =
            new SimpleColumnMetadata(
                    "col1",
                    TupleTypes._FLOAT,
                    0,
                    ColumnMetadata.COLUMN_NULLABLE,
                    20);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    public void testConvertToXML() throws Exception
    {
        StatisticsActivity activity = new StatisticsActivity();
       
        List columns = new ArrayList();
        SimpleColumnMetadata col =
            new SimpleColumnMetadata(
                    "col1",
                    TupleTypes._FLOAT,
                    0,
                    ColumnMetadata.columnNullable,
                    20);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }
   
    public void configure(TupleMetadata metadata)
    throws UnsupportedOperandTypeException
    {
        mType = new SimpleColumnMetadata(
                null,
                mValueType,
                0,
                ColumnMetadata.COLUMN_NO_NULLS,
                0);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

            throws UnsupportedOperandTypeException
    {
        mChild.configure(metadata);
        int type = mChild.getMetadata().getType();
        mEval = NumericEvaluators.getEvaluator(type);
        mType = new SimpleColumnMetadata(
                null,
                type,
                0,
                ColumnMetadata.COLUMN_NO_NULLS,
                0);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

  }

  private MetadataWrapper prepareMetadata(TupleListIterator tuples) throws ActivityUserException, ActivityProcessingException, ActivityTerminatedException {
        TupleMetadata prevMetadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata(prevMetadata.getColumnMetadata(0).getName(), TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
    return new MetadataWrapper(metadata);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.