Examples of Tuple5


Examples of ch.epfl.labos.iu.orm.Tuple5

            case 3:
               return (U)new Tuple3(data[0], data[1], data[2]);
            case 4:
               return (U)new Tuple4(data[0], data[1], data[2], data[3]);
            case 5:
               return (U)new Tuple5(data[0], data[1], data[2], data[3], data[4]);
            case 8:
               return (U)new Tuple8(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
            default:
               throw new IllegalArgumentException("Creating a tuple with a SQLReader with unknown size " + subreaders.length);
         }
View Full Code Here

Examples of eu.stratosphere.api.java.tuple.Tuple5

        .setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("select * from books")
        .finish();
    jdbcInputFormat.open(null);
    Tuple5 tuple = new Tuple5();
    int recordCount = 0;
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      Assert.assertEquals("Field 0 should be int", Integer.class, tuple.getField(0).getClass());
      Assert.assertEquals("Field 1 should be String", String.class, tuple.getField(1).getClass());
      Assert.assertEquals("Field 2 should be String", String.class, tuple.getField(2).getClass());
      Assert.assertEquals("Field 3 should be float", Double.class, tuple.getField(3).getClass());
      Assert.assertEquals("Field 4 should be int", Integer.class, tuple.getField(4).getClass());

      for (int x = 0; x < 5; x++) {
        Assert.assertEquals(dbData[recordCount][x], tuple.getField(x));
      }
      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
  }
View Full Code Here

Examples of eu.stratosphere.api.java.tuple.Tuple5

        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("insert into books (id, title, author, price, qty) values (?,?,?,?,?)")
        .finish();
    jdbcOutputFormat.open(0, 1);

    Tuple5 tuple5 = new Tuple5();
    tuple5.setField(4, 0);
    tuple5.setField("hello", 1);
    tuple5.setField("world", 2);
    tuple5.setField(0.99, 3);
    tuple5.setField("imthewrongtype", 4);

    jdbcOutputFormat.writeRecord(tuple5);
    jdbcOutputFormat.close();
  }
View Full Code Here

Examples of eu.stratosphere.api.java.tuple.Tuple5

        .setDBUrl(dbUrl)
        .setQuery("select * from " + sourceTable)
        .finish();
    jdbcInputFormat.open(null);

    Tuple5 tuple = new Tuple5();
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      jdbcOutputFormat.writeRecord(tuple);
    }

    jdbcOutputFormat.close();
    jdbcInputFormat.close();

    jdbcInputFormat = JDBCInputFormat.buildJDBCInputFormat()
        .setDrivername(driverPath)
        .setDBUrl(dbUrl)
        .setQuery("select * from " + targetTable)
        .finish();
    jdbcInputFormat.open(null);

    int recordCount = 0;
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      Assert.assertEquals("Field 0 should be int", Integer.class, tuple.getField(0).getClass());
      Assert.assertEquals("Field 1 should be String", String.class, tuple.getField(1).getClass());
      Assert.assertEquals("Field 2 should be String", String.class, tuple.getField(2).getClass());
      Assert.assertEquals("Field 3 should be float", Double.class, tuple.getField(3).getClass());
      Assert.assertEquals("Field 4 should be int", Integer.class, tuple.getField(4).getClass());

      for (int x = 0; x < 5; x++) {
        Assert.assertEquals(dbData[recordCount][x], tuple.getField(x));
      }

      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
View Full Code Here

Examples of org.apache.flink.api.java.tuple.Tuple5

        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("insert into books (id, title, author, price, qty) values (?,?,?,?,?)")
        .finish();
    jdbcOutputFormat.open(0, 1);

    Tuple5 tuple5 = new Tuple5();
    tuple5.setField(4, 0);
    tuple5.setField("hello", 1);
    tuple5.setField("world", 2);
    tuple5.setField(0.99, 3);
    tuple5.setField("imthewrongtype", 4);

    jdbcOutputFormat.writeRecord(tuple5);
    jdbcOutputFormat.close();
  }
View Full Code Here

Examples of org.apache.flink.api.java.tuple.Tuple5

        .setDBUrl(dbUrl)
        .setQuery("select * from " + sourceTable)
        .finish();
    jdbcInputFormat.open(null);

    Tuple5 tuple = new Tuple5();
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      jdbcOutputFormat.writeRecord(tuple);
    }

    jdbcOutputFormat.close();
    jdbcInputFormat.close();

    jdbcInputFormat = JDBCInputFormat.buildJDBCInputFormat()
        .setDrivername(driverPath)
        .setDBUrl(dbUrl)
        .setQuery("select * from " + targetTable)
        .finish();
    jdbcInputFormat.open(null);

    int recordCount = 0;
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      Assert.assertEquals("Field 0 should be int", Integer.class, tuple.getField(0).getClass());
      Assert.assertEquals("Field 1 should be String", String.class, tuple.getField(1).getClass());
      Assert.assertEquals("Field 2 should be String", String.class, tuple.getField(2).getClass());
      Assert.assertEquals("Field 3 should be float", Double.class, tuple.getField(3).getClass());
      Assert.assertEquals("Field 4 should be int", Integer.class, tuple.getField(4).getClass());

      for (int x = 0; x < 5; x++) {
        Assert.assertEquals(dbData[recordCount][x], tuple.getField(x));
      }

      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
View Full Code Here

Examples of org.apache.flink.api.java.tuple.Tuple5

        .setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
        .setDBUrl("jdbc:derby:memory:ebookshop")
        .setQuery("select * from books")
        .finish();
    jdbcInputFormat.open(null);
    Tuple5 tuple = new Tuple5();
    int recordCount = 0;
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(tuple);
      Assert.assertEquals("Field 0 should be int", Integer.class, tuple.getField(0).getClass());
      Assert.assertEquals("Field 1 should be String", String.class, tuple.getField(1).getClass());
      Assert.assertEquals("Field 2 should be String", String.class, tuple.getField(2).getClass());
      Assert.assertEquals("Field 3 should be float", Double.class, tuple.getField(3).getClass());
      Assert.assertEquals("Field 4 should be int", Integer.class, tuple.getField(4).getClass());

      for (int x = 0; x < 5; x++) {
        Assert.assertEquals(dbData[recordCount][x], tuple.getField(x));
      }
      recordCount++;
    }
    Assert.assertEquals(5, recordCount);
  }
View Full Code Here

Examples of org.jinq.tuples.Tuple5

         case 3:
            return (T)new Tuple3(data[0], data[1], data[2]);
         case 4:
            return (T)new Tuple4(data[0], data[1], data[2], data[3]);
         case 5:
            return (T)new Tuple5(data[0], data[1], data[2], data[3], data[4]);
         case 8:
            return (T)new Tuple8(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
         default:
            throw new IllegalArgumentException("Creating a tuple with a SQLReader with unknown size " + subreaders.length);
      }
View Full Code Here

Examples of org.jinq.tuples.Tuple5

         case 3:
            return (T)new Tuple3(data[0], data[1], data[2]);
         case 4:
            return (T)new Tuple4(data[0], data[1], data[2], data[3]);
         case 5:
            return (T)new Tuple5(data[0], data[1], data[2], data[3], data[4]);
         case 8:
            return (T)new Tuple8(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
         default:
            throw new IllegalArgumentException("Creating a tuple with a SQLReader with unknown size " + subreaders.length);
      }
View Full Code Here

Examples of scala.Tuple5

         case 3:
            return (T)new Tuple3(data[0], data[1], data[2]);
         case 4:
            return (T)new Tuple4(data[0], data[1], data[2], data[3]);
         case 5:
            return (T)new Tuple5(data[0], data[1], data[2], data[3], data[4]);
         case 8:
            return (T)new Tuple8(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
         default:
            throw new IllegalArgumentException("Creating a tuple with a SQLReader with unknown size " + subreaders.length);
      }
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.