hudi-spark/src/main/java/org/apache/hudi/DataSourceUtils.java
/**
   * Given an Avro field schema checks whether the field is of Logical Date Type or not.
   *
   * @param fieldSchema avro field schema
   * @return boolean indicating whether fieldSchema is of Avro's Date Logical Type
   */
Given an Avro field schema checks whether the field is of Logical Date Type or not.
@param fieldSchema avro field schema
@return boolean indicating whether fieldSchema is of Avro's Date Logical Type
Given an Avro field schema checks whether the field is of Logical Date Type or not . @param fieldSchema avro field schema @return boolean indicating whether fieldSchema is of Avro ' s Date Logical Type
private static boolean isLogicalTypeDate(Schema fieldSchema) {
    if (fieldSchema.getType() == Schema.Type.UNION) {
      return fieldSchema.getTypes().stream().anyMatch(schema -> schema.getLogicalType() == LogicalTypes.date());
    }
    return fieldSchema.getLogicalType() == LogicalTypes.date();
  }
private static boolean isLogicalTypeDate ( Schema fieldSchema ) { if ( fieldSchema . getType ( ) == Schema . Type . UNION ) { return fieldSchema . getTypes ( ) . stream ( ) . anyMatch ( schema -> schema . getLogicalType ( ) == LogicalTypes . date ( ) ) ; } return fieldSchema . getLogicalType ( ) == LogicalTypes . date ( ) ; }
Given an Avro field schema checks whether the field is of Logical Date Type or not.
Given an Avro field schema checks whether the field is of Logical Date Type or not .