Examples of Deserializer


Examples of org.apache.hadoop.hive.serde2.Deserializer

    return createRowInspector(getStructOIFrom(partitionOI), partKeys);
  }

  private StructObjectInspector getRowInspectorFromPartitionedTable(TableDesc table)
      throws Exception {
    Deserializer serde = table.getDeserializerClass().newInstance();
    serde.initialize(job, table.getProperties());
    String pcols = table.getProperties().getProperty(
        org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_PARTITION_COLUMNS);
    String[] partKeys = pcols.trim().split("/");
    row[1] = null;
    return createRowInspector(getStructOIFrom(serde.getObjectInspector()), partKeys);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.Deserializer

      }

      // Choose any partition. It's OI needs to be converted to the table OI
      // Whenever a new partition is being read, a new converter is being created
      PartitionDesc partition = listParts.get(0);
      Deserializer tblSerde = partition.getTableDesc().getDeserializerClass().newInstance();
      tblSerde.initialize(job, partition.getTableDesc().getProperties());

      partitionedTableOI = null;
      ObjectInspector tableOI = tblSerde.getObjectInspector();

      // Get the OI corresponding to all the partitions
      for (PartitionDesc listPart : listParts) {
        partition = listPart;
        Deserializer partSerde = listPart.getDeserializerClass().newInstance();
        partSerde.initialize(job, listPart.getOverlayedProperties());

        partitionedTableOI = ObjectInspectorConverters.getConvertedOI(
            partSerde.getObjectInspector(), tableOI, true);
        if (!partitionedTableOI.equals(tableOI)) {
          break;
        }
      }
      return getRowInspectorFromPartition(partition, partitionedTableOI);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.Deserializer

  public ArrayList<StructField> getFields() {

    ArrayList<StructField> fields = new ArrayList<StructField>();
    try {
      Deserializer decoder = getDeserializer();

      // Expand out all the columns of the table
      StructObjectInspector structObjectInspector = (StructObjectInspector) decoder
          .getObjectInspector();
      List<? extends StructField> fld_lst = structObjectInspector
          .getAllStructFieldRefs();
      for (StructField field : fld_lst) {
        fields.add(field);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.Deserializer

            tbl.getSd().getSerdeInfo().getSerializationLib());
        if (!getColsFromSerDe) {
          ret = tbl.getSd().getCols();
        } else {
          try {
            Deserializer s = MetaStoreUtils.getDeserializer(hiveConf, tbl);
            ret = MetaStoreUtils.getFieldsFromDeserializer(tableName, s);
          } catch (SerDeException e) {
            StringUtils.stringifyException(e);
            throw new MetaException(e.getMessage());
          }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.Deserializer

        int oldTag = newTagToOldTag[i];
        int childIndex = newTagToChildIndex[newTag];
        cntrs[newTag] = 0;
        nextCntrs[newTag] = 0;
        TableDesc keyTableDesc = conf.getKeysSerializeInfos().get(newTag);
        Deserializer inputKeyDeserializer = ReflectionUtils.newInstance(keyTableDesc
            .getDeserializerClass(), null);
        inputKeyDeserializer.initialize(null, keyTableDesc.getProperties());

        TableDesc valueTableDesc = conf.getValuesSerializeInfos().get(newTag);
        Deserializer inputValueDeserializer = ReflectionUtils.newInstance(valueTableDesc
            .getDeserializerClass(), null);
        inputValueDeserializer.initialize(null, valueTableDesc.getProperties());

        List<ObjectInspector> oi = new ArrayList<ObjectInspector>();
        oi.add(inputKeyDeserializer.getObjectInspector());
        oi.add(inputValueDeserializer.getObjectInspector());
        int childParentsCount = conf.getChildIndexToOriginalNumParents().get(childIndex);
        // Multiple newTags can point to the same child (e.g. when the child is a JoinOperator).
        // So, we first check if childInputObjInspectors contains the key of childIndex.
        if (childInputObjInspectors[childIndex] == null) {
          childInputObjInspectors[childIndex] = new ObjectInspector[childParentsCount];
View Full Code Here

Examples of org.apache.hadoop.io.serializer.Deserializer

        String splitClassName = is.readUTF();
        try {
            Class splitClass = conf.getClassByName(splitClassName);
            SerializationFactory sf = new SerializationFactory(conf);
            // The correct call sequence for Deserializer is, we shall open, then deserialize, but we shall not close
            Deserializer d = sf.getDeserializer(splitClass);
            d.open((InputStream) is);
            wrappedSplits = new InputSplit[splitLen];
            for (int i = 0; i < splitLen; i++)
            {
                wrappedSplits[i] = (InputSplit)ReflectionUtils.newInstance(splitClass, conf);
                d.deserialize(wrappedSplits[i]);
            }
        } catch (ClassNotFoundException e) {
            throw new IOException(e);
        }
       
View Full Code Here

Examples of org.apache.hadoop.io.serializer.Deserializer

    inputSplit = (InputSplit) ReflectionUtils.newInstance(inputSplitClass, conf);
    if (inputSplit instanceof Writable) {
      ((Writable) inputSplit).readFields(in);
    } else {
      SerializationFactory factory = new SerializationFactory(conf);
      Deserializer deserializer = factory.getDeserializer(inputSplitClass);
      deserializer.open((DataInputStream) in);
      inputSplit = (InputSplit) deserializer.deserialize(inputSplit);
      deserializer.close();
    }
  }
View Full Code Here

Examples of org.apache.hadoop.io.serializer.Deserializer

        try {
            Class splitClass = conf.getClassByName(splitClassName);
            wrappedSplit = (InputSplit)ReflectionUtils.newInstance(splitClass, conf);
            SerializationFactory sf = new SerializationFactory(conf);
            // The correct call sequence for Deserializer is, we shall open, then deserialize, but we shall not close
            Deserializer d = sf.getDeserializer(splitClass);
            d.open((InputStream) is);
            d.deserialize(wrappedSplit);
        } catch (ClassNotFoundException e) {
            throw new IOException(e);
        }
       
    }
View Full Code Here

Examples of org.apache.soap.util.xml.Deserializer

            } catch (Throwable ignored) {
            Trc.ignoredException(ignored);
            }

        Serializer literalSerializer = partSer;
        Deserializer literalDeserializer = partSer;
        Serializer soapSerializer = beanSer;
        Deserializer soapDeserializer = beanSer;
        String soapEncoding = Constants.NS_URI_SOAP_ENC;

        // initialize ApacheSOAP specific mappings here
        for (Iterator i = theTypeMap.iterator(); i.hasNext();) {
            WSIFDynamicTypeMapping mapping = (WSIFDynamicTypeMapping) i.next();
View Full Code Here

Examples of org.hibernate.search.indexes.serialization.codex.spi.Deserializer

  /**
   * Convert a byte[] to a List of LuceneWork (assuming the same SerializationProvider is used of course)
   */
  @Override
  public List<LuceneWork> toLuceneWorks(byte[] data) {
    Deserializer deserializer = provider.getDeserializer();
    LuceneWorkHydrator hydrator = new LuceneWorkHydrator( searchFactory );
    deserializer.deserialize( data, hydrator );
    return hydrator.getLuceneWorks();
  }
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.