private boolean verifyAndSetVectorPartDesc(
        PartitionDesc pd, boolean isFullAcidTable,
        List<TypeInfo> allTypeInfoList,
        Set<String> inputFileFormatClassNameSet,
        Map<VectorPartitionDesc, VectorPartitionDesc> vectorPartitionDescMap,
        Set<String> enabledConditionsMetSet, List<String> enabledConditionsNotMetList,
        Set<Support> newSupportSet, List<TypeInfo> dataTypeInfoList) {

      Class<? extends InputFormat> inputFileFormatClass = pd.getInputFileFormatClass();
      String inputFileFormatClassName = inputFileFormatClass.getName();
      final TypeInfo[] dataTypeInfos;
      if (dataTypeInfoList == null) {
        dataTypeInfos = EMPTY_TYPEINFO_ARRAY;
      } else {
        dataTypeInfos = dataTypeInfoList.toArray(new TypeInfo[dataTypeInfoList.size()]);
      }

      // Always collect input file formats.
      inputFileFormatClassNameSet.add(inputFileFormatClassName);

      boolean isInputFileFormatVectorized = Utilities.isInputFileFormatVectorized(pd);

      if (isFullAcidTable) {

        // Today, ACID tables are only ORC and that format is vectorizable.  Verify these
        // assumptions.
        Preconditions.checkState(isInputFileFormatVectorized);
        Preconditions.checkState(supportedAcidInputFormats.contains(inputFileFormatClassName));

        if (!useVectorizedInputFileFormat) {
          enabledConditionsNotMetList.add("Vectorizing ACID tables requires "
        + HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname);
          return false;
        }

        addVectorizedInputFileFormatSupport(
            newSupportSet, isInputFileFormatVectorized, inputFileFormatClass, pd.getTableDesc());

        addVectorPartitionDesc(
            pd,
            VectorPartitionDesc.createVectorizedInputFileFormat(
                inputFileFormatClassName,
                Utilities.isInputFileFormatSelfDescribing(pd),
                dataTypeInfos),
            vectorPartitionDescMap);

        enabledConditionsMetSet.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname);
        return true;
      }

      // Look for Pass-Thru case where InputFileFormat has VectorizedInputFormatInterface
      // and reads VectorizedRowBatch as a "row".

      if (useVectorizedInputFileFormat) {

        if (isInputFileFormatVectorized &&
            !isInputFormatExcluded(
                inputFileFormatClassName,
                vectorizedInputFormatExcludes) &&
            !hasUnsupportedVectorizedParquetDataType(
                inputFileFormatClass,
                allTypeInfoList)) {

          addVectorizedInputFileFormatSupport(
              newSupportSet, isInputFileFormatVectorized, inputFileFormatClass, pd.getTableDesc());

          addVectorPartitionDesc(
              pd,
              VectorPartitionDesc.createVectorizedInputFileFormat(
                  inputFileFormatClassName,
                  Utilities.isInputFileFormatSelfDescribing(pd),
                  dataTypeInfos),
              vectorPartitionDescMap);

          enabledConditionsMetSet.add(
              HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname);
          return true;
        }
        // Fall through and look for other options...
      }

      if (!isSchemaEvolution) {
        enabledConditionsNotMetList.add(
            "Vectorizing tables without Schema Evolution requires " + HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname);
        return false;
      }

      String deserializerClassName = pd.getDeserializerClassName();

      // Look for InputFileFormat / Serde combinations we can deserialize more efficiently
      // using VectorDeserializeRow and a deserialize class with the DeserializeRead interface.
      //
      // Do the "vectorized" row-by-row deserialization into a VectorizedRowBatch in the
      // VectorMapOperator.
      boolean isTextFormat = inputFileFormatClassName.equals(TextInputFormat.class.getName()) &&
          deserializerClassName.equals(LazySimpleSerDe.class.getName());
      boolean isSequenceFormat =
          inputFileFormatClassName.equals(SequenceFileInputFormat.class.getName()) &&
                  (deserializerClassName.equals(LazyBinarySerDe.class.getName()) ||
                          deserializerClassName.equals(LazyBinarySerDe2.class.getName()));
      boolean isVectorDeserializeEligable = isTextFormat || isSequenceFormat;

      if (useVectorDeserialize) {

        // Currently, we support LazySimple deserialization:
        //
        //    org.apache.hadoop.mapred.TextInputFormat
        //    org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
        //
        // AND
        //
        //    org.apache.hadoop.mapred.SequenceFileInputFormat
        //    org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe

        if (isTextFormat) {

          Properties properties = pd.getTableDesc().getProperties();
          String lastColumnTakesRestString =
              properties.getProperty(serdeConstants.SERIALIZATION_LAST_COLUMN_TAKES_REST);
          boolean lastColumnTakesRest =
              (lastColumnTakesRestString != null &&
              lastColumnTakesRestString.equalsIgnoreCase("true"));
          if (lastColumnTakesRest) {

            // If row mode will not catch this input file format, then not enabled.
            if (useRowDeserialize && !isInputFormatExcluded(inputFileFormatClassName,
                rowDeserializeInputFormatExcludes)) {
              enabledConditionsNotMetList.add(
                  inputFileFormatClassName + " " +
                  serdeConstants.SERIALIZATION_LAST_COLUMN_TAKES_REST + " must be disabled ");
              return false;
            }
          } else {

            // Add the support for read variations in Vectorized Text.
            newSupportSet.addAll(vectorDeserializeTextSupportSet);

            addVectorPartitionDesc(
                pd,
                VectorPartitionDesc.createVectorDeserialize(
                    inputFileFormatClassName, VectorDeserializeType.LAZY_SIMPLE, dataTypeInfos),
                vectorPartitionDescMap);

            enabledConditionsMetSet.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTOR_DESERIALIZE.varname);
            return true;
          }
        } else if (isSequenceFormat) {

          addVectorPartitionDesc(
              pd,
              VectorPartitionDesc.createVectorDeserialize(
                  inputFileFormatClassName, VectorDeserializeType.LAZY_BINARY, dataTypeInfos),
              vectorPartitionDescMap);

          enabledConditionsMetSet.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTOR_DESERIALIZE.varname);
          return true;
        }
        // Fall through and look for other options...
      }

      // Otherwise, if enabled, deserialize rows using regular Serde and add the object
      // inspect-able Object[] row to a VectorizedRowBatch in the VectorMapOperator.

      if (useRowDeserialize) {
        boolean isRowDeserializeExcluded =
            isInputFormatExcluded(inputFileFormatClassName, rowDeserializeInputFormatExcludes);
        if (!isRowDeserializeExcluded && !isInputFileFormatVectorized) {
          addVectorPartitionDesc(
              pd,
              VectorPartitionDesc.createRowDeserialize(
                  inputFileFormatClassName,
                  Utilities.isInputFileFormatSelfDescribing(pd),
                  deserializerClassName,
                  dataTypeInfos),
              vectorPartitionDescMap);

          enabledConditionsMetSet.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_ROW_DESERIALIZE.varname);
          return true;
        } else if (isInputFileFormatVectorized) {

          /*
           * Vectorizer does not vectorize in row deserialize mode if the input format has
           * VectorizedInputFormat so input formats will be clear if the isVectorized flag
           * is on, they are doing VRB work.
           */
          enabledConditionsNotMetList.add("Row deserialization of vectorized input format not supported");
        } else {
          enabledConditionsNotMetList.add(ConfVars.HIVE_VECTORIZATION_USE_ROW_DESERIALIZE.varname
              + " IS true AND " + ConfVars.HIVE_VECTORIZATION_ROW_DESERIALIZE_INPUTFORMAT_EXCLUDES.varname
              + " NOT CONTAINS " + inputFileFormatClassName);
        }
      }
      if (isInputFileFormatVectorized) {
        if(useVectorizedInputFileFormat) {
          enabledConditionsNotMetList.add(
              ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname + " IS true AND "
                  + ConfVars.HIVE_VECTORIZATION_VECTORIZED_INPUT_FILE_FORMAT_EXCLUDES.varname
                  + " NOT CONTAINS " + inputFileFormatClassName);
        } else {
          enabledConditionsNotMetList
              .add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTORIZED_INPUT_FILE_FORMAT.varname);
        }
      } else {
        // Only offer these when the input file format is not the fast vectorized formats.
        if (isVectorDeserializeEligable) {
          Preconditions.checkState(!useVectorDeserialize);
          enabledConditionsNotMetList.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_VECTOR_DESERIALIZE.varname);
        } else {
          // Since row mode takes everyone.
          enabledConditionsNotMetList.add(HiveConf.ConfVars.HIVE_VECTORIZATION_USE_ROW_DESERIALIZE.varname);
        }
      }

      return false;
    }
Decimal types can be specified with different precision and scales e.g. decimal(10,5),
as opposed to other data types which can be represented by constant strings.
The regex matches only the {@link serdeConstants#DECIMAL_TYPE_NAME} prefix of the type.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java