Package org.apache.hcatalog.data

Examples of org.apache.hcatalog.data.DefaultHCatRecord


            throws IOException, InterruptedException {
            s = value.get(0) == null ? null : (String) value.get(0);
            i = value.get(1) == null ? null : (Integer) value.get(1);
            d = value.get(2) == null ? null : (Double) value.get(2);

            HCatRecord record = new DefaultHCatRecord(3);
            record.set(0, s);
            record.set(1, i);
            record.set(2, d);

            context.write(null, record);

        }
View Full Code Here


            String[] fields = curLine.split("\t");
            List<Object> data = new ArrayList<Object>(3);
            data.add(fields[0]);
            data.add(Integer.parseInt(fields[1]));
            data.add(Double.parseDouble(fields[2]));
            return new DefaultHCatRecord(data);
        }
View Full Code Here

            name = (String) value.get(0);
            age = (Integer) value.get(1);
            gpa = (Double) value.get(2);
            gpa = Math.floor(gpa) + 0.1;

            HCatRecord record = new DefaultHCatRecord(3);
            record.set(0, name);
            record.set(1, age);
            record.set(2, gpa);

            context.write(null, record);

        }
View Full Code Here

            throws IOException, InterruptedException {
            String name = (String) value.get(0);
            int age = (Integer) value.get(1);
            String ds = (String) value.get(3);

            HCatRecord record = (filter == null ? new DefaultHCatRecord(3) : new DefaultHCatRecord(2));
            record.set(0, name);
            record.set(1, age);
            if (filter == null) record.set(2, ds);

            context.write(null, record);
View Full Code Here

            throws IOException, InterruptedException {
            s = value.get(0) == null ? null : (String) value.get(0);
            i = value.get(1) == null ? null : (Integer) value.get(1);
            d = value.get(2) == null ? null : (Double) value.get(2);

            HCatRecord record = new DefaultHCatRecord(5);
            record.set(0, s);
            record.set(1, i);
            record.set(2, d);

            context.write(null, record);

        }
View Full Code Here

            age = value.get(1) == null ? null : (Integer) value.get(1);
            gpa = value.get(2) == null ? null : (Double) value.get(2);

            if (gpa != null) gpa = Math.floor(gpa) + 0.1;

            HCatRecord record = new DefaultHCatRecord(5);
            record.set(0, name);
            record.set(1, age);
            record.set(2, gpa);

            context.write(null, record);

        }
View Full Code Here

            Iterator<IntWritable> iter = values.iterator();
            while (iter.hasNext()) {
                sum++;
                iter.next();
            }
            HCatRecord record = new DefaultHCatRecord(2);
            record.set(0, key.get());
            record.set(1, sum);

            context.write(null, record);
        }
View Full Code Here

    * create record
    * @param vertex to populate record
    * @return HCatRecord newly created
    */
    protected HCatRecord createRecord(Vertex<I, V, E, ?> vertex) {
      HCatRecord record = new DefaultHCatRecord(getNumColumns());
      fillRecord(record, vertex);
      return record;
    }
View Full Code Here

    HCatSchema hCatTblSchema, ColumnGenerator... extraCols) throws Exception {
    List<HCatRecord> records = new ArrayList<HCatRecord>();
    List<HCatFieldSchema> hCatTblCols = hCatTblSchema.getFields();
    int size = hCatTblCols.size();
    for (int i = 0; i < numRecords; ++i) {
      DefaultHCatRecord record = new DefaultHCatRecord(size);
      record.set(hCatTblCols.get(0).getName(), hCatTblSchema, i);
      record.set(hCatTblCols.get(1).getName(), hCatTblSchema, "textfield" + i);
      boolean staticFound = false;
      int idx = 0;
      for (int j = 0; j < extraCols.length; ++j) {
        if (extraCols[j].getKeyType() == KeyType.STATIC_KEY
          && !staticFound) {
          staticFound = true;
          continue;
        }
        record.set(hCatTblCols.get(idx + 2).getName(), hCatTblSchema,
          extraCols[j].getHCatValue(i));
        ++idx;
      }

      records.add(record);
View Full Code Here

    rec_1.add( new Integer(INT_CONST));
    rec_1.add( new Long(LONG_CONST));
    rec_1.add( new Double(DOUBLE_CONST));
    rec_1.add( new String(STRING_CONST));

    return new DefaultHCatRecord(rec_1);
  }
View Full Code Here

TOP

Related Classes of org.apache.hcatalog.data.DefaultHCatRecord

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.