Package org.apache.hive.hcatalog.data

Examples of org.apache.hive.hcatalog.data.HCatRecord


      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

      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

      b = (Long) value.get(3);
      f = (Float) value.get(4);
      d = (Double) value.get(5);
      s = (String) value.get(6);

      HCatRecord record = new DefaultHCatRecord(7);
      record.set(0, t);
      record.set(1, si);
      record.set(2, i);
      record.set(3, b);
      record.set(4, f);
      record.set(5, d);
      record.set(6, s);

      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(3);
      record.set(0, s);
      record.set(1, i);
      record.set(2, d);

      context.write(null, record);

    }
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

    try {
      committer = outFormat.getOutputCommitter(cntxt);
      committer.setupTask(cntxt);
      writer = outFormat.getRecordWriter(cntxt);
      while (recordItr.hasNext()) {
        HCatRecord rec = recordItr.next();
        writer.write(null, rec);
      }
      writer.close(cntxt);
      if (committer.needsTaskCommit(cntxt)) {
        committer.commitTask(cntxt);
View Full Code Here

      intnum100 = (((Integer) value.get(3)));
      intnum = ((Integer) value.get(4));
      longnum = ((Long) value.get(5));
      floatnum = ((Float) value.get(6));
      doublenum = ((Double) value.get(7));
      HCatRecord output = new DefaultHCatRecord(8);
      output.set(0, intnum1000 + 10);
      if (isnoPartPig) {
        output.set(1, ((int) (id + 10)));
      } else {
        output.set(1, ((short) (id + 10)));
      }
      if (isnoPartPig) {
        output.set(2, (int) (intnum5 + 10));
      } else {
        output.set(2, (byte) (intnum5 + 10));
      }

      output.set(3, intnum100 + 10);
      output.set(4, intnum + 10);
      output.set(5, (long) (longnum + 10));
      output.set(6, (float) (floatnum + 10));
      output.set(7, (double) (doublenum + 10));
      for (int i = 0; i < 8; i++) {
        System.err.println("XXX: class:" + output.get(i).getClass());
      }
      context.write(new IntWritable(0), output);

    }
View Full Code Here

      b = (Long) value.get(3);
      f = (Float) value.get(4);
      d = (Double) value.get(5);
      s = (String) value.get(6);

      HCatRecord record = new DefaultHCatRecord(7);
      record.set(0, t);
      record.set(1, si);
      record.set(2, i);
      record.set(3, b);
      record.set(4, f);
      record.set(5, d);
      record.set(6, s);

      context.write(null, record);

    }
View Full Code Here

TOP

Related Classes of org.apache.hive.hcatalog.data.HCatRecord

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.