private boolean checkSchema(ObjectIdentifier identifier, HiveWriterFactory writerFactory, RowType schema) {
        HashMap<ObjectIdentifier, Long> schemaCheckTimeMap = CacheHolder.getSchemaCheckTimeMap();
        long lastUpdate = schemaCheckTimeMap.getOrDefault(identifier, -1L);
        // handle the schema every `HIVE_SCHEMA_SCAN_INTERVAL` milliseconds
        int scanSchemaInterval = Integer.parseInt(writerFactory.getJobConf()
                .get(HIVE_SCHEMA_SCAN_INTERVAL.key(), HIVE_SCHEMA_SCAN_INTERVAL.defaultValue() + ""));
        boolean changed = false;
        if (System.currentTimeMillis() - lastUpdate >= scanSchemaInterval) {
            changed = HiveTableUtil.changeSchema(schema, writerFactory.getAllColumns(),
                    writerFactory.getAllTypes(), identifier.getDatabaseName(), identifier.getObjectName(), hiveVersion);
            schemaCheckTimeMap.put(identifier, System.currentTimeMillis());
        }
        return changed;
    }
check if source table schema changes

@param identifier hive database name and table name
@param writerFactory hive writer factory
@param schema hive field with flink types
@return if schema has changed
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/hive/src/main/java/org/apache/inlong/sort/hive/filesystem/HadoopPathBasedPartFileWriter.java