private Schema getSchema(Configuration conf, Properties tbl, ColumnMapping colMap)
      throws Exception {
    String serType = null;
    String serClassName = null;
    String schemaLiteral = null;
    String schemaUrl = null;

    if (colMap.qualifierName == null) {
      // only a column family

      if (colMap.qualifierPrefix != null) {
        serType =
            tbl.getProperty(colMap.familyName + "." + colMap.qualifierPrefix + "."
                + HBaseSerDe.SERIALIZATION_TYPE);

        serClassName =
            tbl.getProperty(colMap.familyName + "." + colMap.qualifierPrefix + "."
                + serdeConstants.SERIALIZATION_CLASS);

        schemaLiteral =
            tbl.getProperty(colMap.familyName + "." + colMap.qualifierPrefix + "."
                + AvroTableProperties.SCHEMA_LITERAL.getPropName());

        schemaUrl =
            tbl.getProperty(colMap.familyName + "." + colMap.qualifierPrefix + "."
                + AvroTableProperties.SCHEMA_URL.getPropName());
      } else {
        serType = tbl.getProperty(colMap.familyName + "." + HBaseSerDe.SERIALIZATION_TYPE);

        serClassName =
            tbl.getProperty(colMap.familyName + "." + serdeConstants.SERIALIZATION_CLASS);

        schemaLiteral = tbl.getProperty(colMap.familyName + "." + AvroTableProperties.SCHEMA_LITERAL.getPropName());

        schemaUrl = tbl.getProperty(colMap.familyName + "." + AvroTableProperties.SCHEMA_URL.getPropName());
      }
    } else if (!colMap.hbaseRowKey) {
      // not an hbase row key. This should either be a prefix or an individual qualifier
      String qualifierName = colMap.qualifierName;

      if (colMap.qualifierName.endsWith("*")) {
        qualifierName = colMap.qualifierName.substring(0, colMap.qualifierName.length() - 1);
      }

      serType =
          tbl.getProperty(colMap.familyName + "." + qualifierName + "."
              + HBaseSerDe.SERIALIZATION_TYPE);

      serClassName =
          tbl.getProperty(colMap.familyName + "." + qualifierName + "."
              + serdeConstants.SERIALIZATION_CLASS);

      schemaLiteral =
          tbl.getProperty(colMap.familyName + "." + qualifierName + "."
              + AvroTableProperties.SCHEMA_LITERAL.getPropName());

      schemaUrl =
          tbl.getProperty(colMap.familyName + "." + qualifierName + "." + AvroTableProperties.SCHEMA_URL.getPropName());
    }

    if (serType == null) {
      throw new IllegalArgumentException("serialization.type property is missing");
    }

    String avroSchemaRetClass = tbl.getProperty(AvroTableProperties.SCHEMA_RETRIEVER.getPropName());

    if (schemaLiteral == null && serClassName == null && schemaUrl == null
        && avroSchemaRetClass == null) {
      throw new IllegalArgumentException("serialization.type was set to [" + serType
          + "] but neither " + AvroTableProperties.SCHEMA_LITERAL.getPropName() + ", " + AvroTableProperties.SCHEMA_URL.getPropName()
          + ", serialization.class or " + AvroTableProperties.SCHEMA_RETRIEVER.getPropName() + " property was set");
    }

    Class<?> deserializerClass = null;

    if (serClassName != null) {
      deserializerClass = loadClass(serClassName, conf);
    }

    Schema schema = null;

    // only worry about getting schema if we are dealing with Avro
    if (serType.equalsIgnoreCase(AVRO_SERIALIZATION_TYPE)) {
      if (avroSchemaRetClass == null) {
        // bother about generating a schema only if a schema retriever class wasn't provided
        if (schemaLiteral != null) {
          schema = Schema.parse(schemaLiteral);
        } else if (schemaUrl != null) {
          schema = HBaseSerDeHelper.getSchemaFromFS(schemaUrl, conf);
        } else if (deserializerClass != null) {
          schema = ReflectData.get().getSchema(deserializerClass);
        }
      }
    }

    return schema;
  }
Get the type for the given {@link ColumnMapping colMap}
hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseSerDeParameters.java