Examples of ByteWritable


Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

  }

  // returns filter result of left object by filters associated with right alias
  private boolean isLeftFiltered(int left, int right, List<Object> leftObj) {
    if (joinValues.get(order[left]).size() < leftObj.size()) {
      ByteWritable filter = (ByteWritable) leftObj.get(leftObj.size() - 1);
      return JoinUtil.isFiltered(filter.get(), right);
    }
    return false;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

  }

  // returns filter result of right object by filters associated with left alias
  private boolean isRightFiltered(int left, int right, List<Object> rightObj) {
    if (joinValues.get(order[right]).size() < rightObj.size()) {
      ByteWritable filter = (ByteWritable) rightObj.get(rightObj.size() - 1);
      return JoinUtil.isFiltered(filter.get(), left);
    }
    return false;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    // Compute the keys
    Object[] nr;
    if (filterMap != null) {
      nr = new Object[valueFields.size()+1];
      // add whether the row is filtered or not.
      nr[valueFields.size()] = new ByteWritable(isFiltered(row, filters, filtersOI, filterMap));
    }else{
      nr = new Object[valueFields.size()];
    }

    for (int i = 0; i < valueFields.size(); i++) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

          .evaluate(row), valueFieldsOI.get(i),
          ObjectInspectorCopyOption.WRITABLE));
    }
    if (filterMap != null) {
      // add whether the row is filtered or not.
      nr.add(new ByteWritable(isFiltered(row, filters, filtersOI, filterMap)));
    }

    return nr;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    bu.put(colbdouble,  "5.3".getBytes());
    bu.put(colcstring,  "hive and hadoop".getBytes());
     
    Object[] expectedFieldsData = {
      new Text("test-row1"),
      new ByteWritable((byte)123),
      new ShortWritable((short)456),
      new IntWritable(789),
      new LongWritable(1000),
      new DoubleWritable(5.3),
      new Text("hive and hadoop")
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

      assertNull(expected.boolean1);
    } else {
      assertEquals(expected.boolean1.booleanValue(), boolean1.get());
    }

    ByteWritable byte1 = (ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize();
    if (byte1 == null) {
      assertNull(expected.byte1);
    } else {
      assertEquals(expected.byte1.byteValue(), byte1.get());
    }

    OrcLazyShort lazyShort1 = (OrcLazyShort) row.getFieldValue(2);
    ShortWritable short1 = (ShortWritable) lazyShort1.materialize();
    if (short1 == null) {
View Full Code Here

Examples of org.apache.hadoop.io.ByteWritable

    assertEquals(md5HashKey1, md5HashKey2);
  }

  @Test
  public void testMD5HashForByteWritableKey() throws IOException {
    ByteWritable key = new ByteWritable(new Byte("123"));
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.ByteWritable

    MapWritable map = new MapWritable();
    map.put(new Text("one"), new VIntWritable(1));
    map.put(new Text("two"), new VLongWritable(2));
    Writable[] writables = new Writable[] {
      new BytesWritable(new byte[] { 1, 2, 3, 4 }),
      new ByteWritable((byte) 123), new BooleanWritable(true),
      new VIntWritable(12345), new VLongWritable(123456789L),
      new FloatWritable((float) 1.2), new DoubleWritable(1.234),
      new Text("random string"),
      new ObjectWritable("test")
    };
View Full Code Here

Examples of org.apache.hadoop.io.ByteWritable

        final Path file = new Path(new File("target/test/test-camel-byte").getAbsolutePath());
        Configuration conf = new Configuration();
        FileSystem fs1 = FileSystem.get(file.toUri(), conf);
        SequenceFile.Writer writer = createWriter(fs1, conf, file, NullWritable.class, ByteWritable.class);
        NullWritable keyWritable = NullWritable.get();
        ByteWritable valueWritable = new ByteWritable();
        byte value = 3;
        valueWritable.set(value);
        writer.append(keyWritable, valueWritable);
        writer.sync();
        writer.close();

        context.addRoutes(new RouteBuilder() {
View Full Code Here

Examples of org.apache.hadoop.io.ByteWritable

        writableTypeToJson(MD5Hash.digest("md5hash"));
    }

    @Test
    public void testByte() {
        writableTypeToJson(new ByteWritable(Byte.MAX_VALUE));
    }
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.