public static ConstantVectorExpression create(int outputColumnNum, Object constantValue, TypeInfo outputTypeInfo)
      throws HiveException {

    if (constantValue == null) {
      return new ConstantVectorExpression(outputColumnNum, outputTypeInfo, true);
    }

    Category category = outputTypeInfo.getCategory();
    switch (category) {
    case PRIMITIVE:
      {
        PrimitiveTypeInfo primitiveTypeInfo = (PrimitiveTypeInfo) outputTypeInfo;
        PrimitiveCategory primitiveCategory = primitiveTypeInfo.getPrimitiveCategory();
        switch (primitiveCategory) {
        case BOOLEAN:
          if (((Boolean) constantValue).booleanValue()) {
            return new ConstantVectorExpression(outputColumnNum, 1, outputTypeInfo);
          } else {
            return new ConstantVectorExpression(outputColumnNum, 0, outputTypeInfo);
          }
        case BYTE:
        case SHORT:
        case INT:
        case LONG:
          return new ConstantVectorExpression(
              outputColumnNum, ((Number) constantValue).longValue(), outputTypeInfo);
        case FLOAT:
        case DOUBLE:
          return new ConstantVectorExpression(
              outputColumnNum, ((Number) constantValue).doubleValue(), outputTypeInfo);
        case DATE:
          return new ConstantVectorExpression(
              outputColumnNum, DateWritableV2.dateToDays((Date) constantValue), outputTypeInfo);
        case TIMESTAMP:
          return new ConstantVectorExpression(
              outputColumnNum,
              ((org.apache.hadoop.hive.common.type.Timestamp) constantValue).toSqlTimestamp(),
              outputTypeInfo);
        case DECIMAL:
          return new ConstantVectorExpression(
              outputColumnNum, (HiveDecimal) constantValue, outputTypeInfo);
        case STRING:
          return new ConstantVectorExpression(
              outputColumnNum, ((String) constantValue).getBytes(StandardCharsets.UTF_8), outputTypeInfo);
        case VARCHAR:
          return new ConstantVectorExpression(
              outputColumnNum, ((HiveVarchar) constantValue), outputTypeInfo);
        case CHAR:
          return new ConstantVectorExpression(
              outputColumnNum, ((HiveChar) constantValue), outputTypeInfo);
        case BINARY:
          return new ConstantVectorExpression(
              outputColumnNum, ((byte[]) constantValue), outputTypeInfo);
        case INTERVAL_YEAR_MONTH:
          return new ConstantVectorExpression(
              outputColumnNum,
              ((HiveIntervalYearMonth) constantValue).getTotalMonths(),
              outputTypeInfo);
        case INTERVAL_DAY_TIME:
          return new ConstantVectorExpression(
              outputColumnNum,
              (HiveIntervalDayTime) constantValue,
              outputTypeInfo);
        case VOID:
        case TIMESTAMPLOCALTZ:
        case UNKNOWN:
        default:
          throw new RuntimeException("Unexpected primitive category " + primitiveCategory);
        }
      }
    // case LIST:
    //   return ConstantVectorExpression.createList(
    //       outputColumnNum, constantValue, outputTypeInfo);
    // case MAP:
    //   return ConstantVectorExpression.createMap(
    //       outputColumnNum, constantValue, outputTypeInfo);
    case STRUCT:
      return ConstantVectorExpression.createStruct(
          outputColumnNum, constantValue, outputTypeInfo);
    // case UNION:
    //   return ConstantVectorExpression.createUnion(
    //       outputColumnNum, constantValue, outputTypeInfo);
    default:
      throw new RuntimeException("Unexpected category " + category);
    }
  }
Constant is represented as a vector with repeating values.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java