Пример #1
0
 protected void createOdpsTable(
     String tableName, String[] partitionCols, ColumnGenerator... extraCols) throws OdpsException {
   TableSchema schema = new TableSchema();
   schema.addColumn(new Column("id", OdpsType.BIGINT));
   schema.addColumn(new Column("msg", OdpsType.STRING));
   int colNum = 0;
   for (ColumnGenerator generator : extraCols) {
     schema.addColumn(new Column(forIdx(colNum++), generator.getOdpsType()));
   }
   if (partitionCols != null) {
     for (String partition : partitionCols) {
       schema.addPartitionColumn(new Column(partition, OdpsType.STRING));
     }
   }
   odps.tables().create(tableName, schema);
 }
Пример #2
0
 public RowBasedSet(TableSchema schema) {
   descriptors = schema.toTypeDescriptors();
   rows = new RemovableList<TRow>();
 }