Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.SerializableNativeValue$Serializer


    }

    @JsonProperty("value")
    public SerializableNativeValue getSerializableNativeValue()
    {
        return new SerializableNativeValue(type, value);
    }
View Full Code Here


    private static final JsonCodec<SimpleRange> codec = JsonCodec.jsonCodec(SimpleRange.class);

    @Test
    public void testRoundTrip()
    {
        SimpleMarker low = new SimpleMarker(true, new SerializableNativeValue(Long.class, new Long(10)));
        SimpleMarker high = new SimpleMarker(false, new SerializableNativeValue(Long.class, new Long(100)));

        SimpleRange expected = new SimpleRange(Optional.fromNullable(low), Optional.fromNullable(high));

        String json = codec.toJson(expected);
        SimpleRange actual = codec.fromJson(json);
View Full Code Here

    private static final JsonCodec<SimpleMarker> codec = JsonCodec.jsonCodec(SimpleMarker.class);

    @Test
    public void testRoundTrip()
    {
        SimpleMarker expected = new SimpleMarker(true, new SerializableNativeValue(Long.class, new Long(10)));
        assertEquals(codec.fromJson(codec.toJson(expected)), expected);

        expected = new SimpleMarker(false, new SerializableNativeValue(Double.class, new Double(10)));
        assertEquals(codec.fromJson(codec.toJson(expected)), expected);

        expected = new SimpleMarker(true, new SerializableNativeValue(Boolean.class, new Boolean(true)));
        assertEquals(codec.fromJson(codec.toJson(expected)), expected);

        expected = new SimpleMarker(true, new SerializableNativeValue(String.class, new String("123")));
        assertEquals(codec.fromJson(codec.toJson(expected)), expected);
    }
View Full Code Here

    private static final JsonCodec<SimpleDomain> codec = JsonCodec.jsonCodec(SimpleDomain.class);

    @Test
    public void testRoundTrip()
    {
        SimpleMarker low = new SimpleMarker(true, new SerializableNativeValue(Long.class, new Long(10)));
        SimpleMarker high = new SimpleMarker(false, new SerializableNativeValue(Long.class, new Long(100)));
        List<SimpleRange> ranges = ImmutableList.of(new SimpleRange(Optional.fromNullable(low), Optional.fromNullable(high)));
        SimpleDomain expected = new SimpleDomain(true, Optional.fromNullable(ranges));

        String json = codec.toJson(expected);
        SimpleDomain actual = codec.fromJson(json);
View Full Code Here

    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    boolean isCompressed = conf.getCompressed();
    TableDesc tableInfo = conf.getTableInfo();
    try {
      Serializer serializer = (Serializer) tableInfo.getDeserializerClass().newInstance();
      serializer.initialize(null, tableInfo.getProperties());
      outputClass = serializer.getSerializedClass();
      hiveOutputFormat = conf.getTableInfo().getOutputFileFormatClass().newInstance();
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
View Full Code Here

    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    boolean isCompressed = conf.getCompressed();
    TableDesc tableInfo = conf.getTableInfo();
    try {
      Serializer serializer = (Serializer) tableInfo.getDeserializerClass().newInstance();
      serializer.initialize(null, tableInfo.getProperties());
      outputClass = serializer.getSerializedClass();
      hiveOutputFormat = conf.getTableInfo().getOutputFileFormatClass().newInstance();
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
View Full Code Here

    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    boolean isCompressed = conf.getCompressed();
    TableDesc tableInfo = conf.getTableInfo();
    try {
      Serializer serializer = (Serializer) tableInfo.getDeserializerClass().newInstance();
      serializer.initialize(null, tableInfo.getProperties());
      outputClass = serializer.getSerializedClass();
      hiveOutputFormat = conf.getTableInfo().getOutputFileFormatClass().newInstance();
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
View Full Code Here

    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    boolean isCompressed = conf.getCompressed();
    TableDesc tableInfo = conf.getTableInfo();
    try {
      Serializer serializer = (Serializer) tableInfo.getDeserializerClass().newInstance();
      serializer.initialize(null, tableInfo.getProperties());
      outputClass = serializer.getSerializedClass();
      hiveOutputFormat = conf.getTableInfo().getOutputFileFormatClass().newInstance();
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
View Full Code Here

    HiveOutputFormat<?, ?> hiveOutputFormat = null;
    Class<? extends Writable> outputClass = null;
    boolean isCompressed = conf.getCompressed();
    TableDesc tableInfo = conf.getTableInfo();
    try {
      Serializer serializer = (Serializer) tableInfo.getDeserializerClass().newInstance();
      serializer.initialize(null, tableInfo.getProperties());
      outputClass = serializer.getSerializedClass();
      hiveOutputFormat = conf.getTableInfo().getOutputFileFormatClass().newInstance();
    } catch (SerDeException e) {
      throw new HiveException(e);
    } catch (InstantiationException e) {
      throw new HiveException(e);
View Full Code Here

    OutputInfo oti = outputConf.readOutputTableInfo();

    HiveUtils.setRCileNumColumns(conf, oti.getColumnInfo().size());
    HadoopUtils.setOutputKeyWritableClass(conf, NullWritable.class);

    Serializer serializer = oti.createSerializer(conf);
    HadoopUtils.setOutputValueWritableClass(conf,
        serializer.getSerializedClass());

    org.apache.hadoop.mapred.OutputFormat baseOutputFormat =
        ReflectionUtils.newInstance(oti.getOutputFormatClass(), conf);
    // CHECKSTYLE: stop LineLength
    org.apache.hadoop.mapred.RecordWriter<WritableComparable, Writable> baseWriter =
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.SerializableNativeValue$Serializer

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.