public Properties asProperties()

in spark-doris-connector/src/main/java/org/apache/doris/spark/cfg/SparkSettings.java [55:76]


    public Properties asProperties() {
        Properties props = new Properties();

        if (cfg != null) {
            String sparkPrefix = "spark.";
            for (Tuple2<String, String> tuple : cfg.getAll()) {
                // spark. are special so save them without the prefix as well
                // since its unlikely the other implementations will be aware of this convention
                String key = tuple._1;
                props.setProperty(key, tuple._2);
                if (key.startsWith(sparkPrefix)) {
                    String simpleKey = key.substring(sparkPrefix.length());
                    // double check to not override a property defined directly in the config
                    if (!props.containsKey(simpleKey)) {
                        props.setProperty(simpleKey, tuple._2);
                    }
                }
            }
        }

        return props;
    }