Examples of SimpleColumnMetadata


Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

     * @return a newly created MetadataWrapper
     */
    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

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    private TupleMetadata prepareMetadata(FullListTupleListIterator itemsIterator) throws ActivityUserException, ActivityProcessingException, ActivityTerminatedException {
      Tuple item;
      List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
      while((item = (Tuple)itemsIterator.nextValue()) != null) {
        columns.add(new SimpleColumnMetadata(item.getString(1), TupleTypes._STRING,
                    0,
                    ColumnMetadata.COLUMN_NO_NULLS,
                    0));       
      }
      TupleMetadata metadata = new SimpleTupleMetadata(columns);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

   
    public void testClassifyDates() throws Exception
    {
        // create simple table
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("class", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("date", TupleTypes._DATE, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
        table.add(ControlBlock.LIST_BEGIN);
        table.add(new MetadataWrapper(metadata));
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

   
    public void testClassifyNumericClass() throws Exception
    {
        // create simple table
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("class", TupleTypes._DOUBLE, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("attribute", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
        table.add(ControlBlock.LIST_BEGIN);
        table.add(new MetadataWrapper(metadata));
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

//  +----------+-------+-------------+----------+------+
// 
    private List<Object> buildInputTable()
    {
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("outlook", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("windy", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("temperature", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("humidity", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("play", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
     
        List<Object> result = new ArrayList<Object>();
     
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

//  +----------+-------+-------------+----------+------+
// 
    private List<Object> buildInputTable()
    {
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("outlook", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("windy", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("temperature", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("humidity", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("play", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
     
        List<Object> result = new ArrayList<Object>();
     
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    }
   
    public void testSimple() throws Exception
    {
        List<ColumnMetadata> cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("cust_id", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("items_bought", TupleTypes._STRING, 0, 0, 11));
        SimpleTupleMetadata metadata = new SimpleTupleMetadata(cdlist);
       
        ConversionActivity activity = new ConversionActivity();
        MockInputPipe input = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

    {
        validateOutput(OUTPUT);
        mOutput = getOutput();
        try{
            mOutput.write(ControlBlock.LIST_BEGIN);
            ColumnMetadata columnMetadata = new SimpleColumnMetadata
                ("", TupleTypes._STRING, 0, ColumnMetadata.COLUMN_NO_NULLS, 0);
            TupleMetadata tupleMetadata =
                new SimpleTupleMetadata(Collections.singletonList(columnMetadata));
            MetadataWrapper metadataWrapper = new MetadataWrapper(tupleMetadata);
            mOutput.write(metadataWrapper);
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

   
    public void testSimpleSortByOneColumn() throws Exception
    {
        final int TUPLE_COUNT = 20000;
        List<ColumnMetadata> cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("A", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("C", TupleTypes._INT, 0, 0, 11));
        TupleMetadata metadata = new SimpleTupleMetadata(cdlist);
        TestBlockReader input = new TestBlockReader(TUPLE_COUNT);
        input.setTupleFactory(new SimpleTupleFactory());
        input.setTupleMetadata(metadata);
        SortActivity activity = new SortActivity();
View Full Code Here

Examples of uk.org.ogsadai.tuple.SimpleColumnMetadata

   
    public void testSimpleSortByTwoColumns() throws Exception
    {
        final int TUPLE_COUNT = 20000;
        List<ColumnMetadata> cdlist = new ArrayList<ColumnMetadata>();
        cdlist.add(new SimpleColumnMetadata("A", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("B", TupleTypes._INT, 0, 0, 11));
        cdlist.add(new SimpleColumnMetadata("C", TupleTypes._INT, 0, 0, 11));
        TupleMetadata metadata = new SimpleTupleMetadata(cdlist);
        TestBlockReader input = new TestBlockReader(TUPLE_COUNT);
        input.setTupleFactory(new SimpleTupleFactory());
        input.setTupleMetadata(metadata);
        SortActivity activity = new SortActivity();
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.