private void validateAndVectorizeMapWork(MapWork mapWork, VectorTaskColumnInfo vectorTaskColumnInfo,
        boolean isTez) throws SemanticException {

      //--------------------------------------------------------------------------------------------

      LOG.info("Examining input format to see if vectorization is enabled.");

      ImmutablePair<String,TableScanOperator> onlyOneTableScanPair = verifyOnlyOneTableScanOperator(mapWork);
      if (onlyOneTableScanPair == null) {
        VectorizerReason notVectorizedReason = currentBaseWork.getNotVectorizedReason();
        Preconditions.checkState(notVectorizedReason != null);
        mapWork.setVectorizationEnabledConditionsNotMet(Collections.singleton(notVectorizedReason.toString()));
        return;
      }
      String alias = onlyOneTableScanPair.left;
      TableScanOperator tableScanOperator = onlyOneTableScanPair.right;

      // This call fills in the column names, types, and partition column count in
      // vectorTaskColumnInfo.
      currentOperator = tableScanOperator;
      ImmutablePair<Boolean, Boolean> validateInputFormatAndSchemaEvolutionPair =
          validateInputFormatAndSchemaEvolution(
              mapWork, alias, tableScanOperator, vectorTaskColumnInfo);
      if (!validateInputFormatAndSchemaEvolutionPair.left) {
        // Have we already set the enabled conditions not met?
        if (!validateInputFormatAndSchemaEvolutionPair.right) {
          VectorizerReason notVectorizedReason = currentBaseWork.getNotVectorizedReason();
          Preconditions.checkState(notVectorizedReason != null);
          mapWork.setVectorizationEnabledConditionsNotMet(Collections.singleton(notVectorizedReason.toString()));
        }
        return;
      }

      final int dataColumnCount =
          vectorTaskColumnInfo.allColumnNames.size() - vectorTaskColumnInfo.partitionColumnCount;

      /*
       * Take what all input formats support and eliminate any of them not enabled by
       * the Hive variable.
       */
      List<String> supportRemovedReasons = new ArrayList<String>();
      Set<Support> supportSet = new TreeSet<Support>();
      if (vectorTaskColumnInfo.inputFormatSupportSet != null) {
        supportSet.addAll(vectorTaskColumnInfo.inputFormatSupportSet);
      }
      // The retainAll method does set intersection.
      supportSet.retainAll(vectorizedInputFormatSupportEnabledSet);
      if (!supportSet.equals(vectorTaskColumnInfo.inputFormatSupportSet)) {

        Set<Support> removedSet = new TreeSet<Support>();
        removedSet.addAll(vectorizedInputFormatSupportEnabledSet);
        removedSet.removeAll(supportSet);
        String removeString =
            removedSet.toString() + " is disabled because it is not in " +
            HiveConf.ConfVars.HIVE_VECTORIZED_INPUT_FORMAT_SUPPORTS_ENABLED.varname +
            " " + vectorizedInputFormatSupportEnabledSet.toString();
        supportRemovedReasons.add(removeString);
      }

      // Now remember what is supported for this query and any support that was
      // removed.
      vectorTaskColumnInfo.setSupportSetInUse(supportSet);
      vectorTaskColumnInfo.setSupportRemovedReasons(supportRemovedReasons);

      final boolean isSupportDecimal64 = supportSet.contains(Support.DECIMAL_64);
      List<DataTypePhysicalVariation> dataTypePhysicalVariations = new ArrayList<DataTypePhysicalVariation>();
      for (int i = 0; i < dataColumnCount; i++) {
        DataTypePhysicalVariation dataTypePhysicalVariation = DataTypePhysicalVariation.NONE;
        if (isSupportDecimal64) {
          TypeInfo typeInfo = vectorTaskColumnInfo.allTypeInfos.get(i);
          if (typeInfo instanceof DecimalTypeInfo) {
            DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) typeInfo;
            if (HiveDecimalWritable.isPrecisionDecimal64(decimalTypeInfo.precision())) {
              dataTypePhysicalVariation = DataTypePhysicalVariation.DECIMAL_64;
            }
          }
        }
        dataTypePhysicalVariations.add(dataTypePhysicalVariation);
      }
      // It simplifies things to just add default ones for partitions.
      for (int i = 0; i < vectorTaskColumnInfo.partitionColumnCount; i++) {
        dataTypePhysicalVariations.add(DataTypePhysicalVariation.NONE);
      }
      vectorTaskColumnInfo.setAlldataTypePhysicalVariations(dataTypePhysicalVariations);

      // Set global member indicating which virtual columns are possible to be used by
      // the Map vertex.
      availableVectorizedVirtualColumnSet = new HashSet<VirtualColumn>();
      availableVectorizedVirtualColumnSet.addAll(vectorTaskColumnInfo.availableVirtualColumnList);

      // And, use set to remember which virtual columns were actually referenced.
      neededVirtualColumnSet = new HashSet<VirtualColumn>();

      mapWork.setVectorizationEnabled(true);
      LOG.info("Vectorization is enabled for input format(s) " + mapWork.getVectorizationInputFileFormatClassNameSet().toString());

      //--------------------------------------------------------------------------------------------

      /*
       * Validate and vectorize the Map operator tree.
       */
      if (!validateAndVectorizeMapOperators(mapWork, tableScanOperator, isTez, vectorTaskColumnInfo)) {
        return;
      }

      //--------------------------------------------------------------------------------------------

      vectorTaskColumnInfo.transferToBaseWork(mapWork);

      mapWork.setVectorMode(true);
    }
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