Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,21 @@ public SparkContext createSparkContext() {

for (Object k : intpProperty.keySet()) {
String key = (String) k;
if (key.startsWith("spark.")) {
Object value = intpProperty.get(key);
if (value != null
&& value instanceof String
&& !((String) value).trim().isEmpty()) {
logger.debug(String.format("SparkConf: key = [%s], value = [%s]", key, value));
conf.set(key, (String) value);
}
Object value = intpProperty.get(key);
if (!isEmptyString(value)) {
logger.debug(String.format("SparkConf: key = [%s], value = [%s]", key, value));
conf.set(key, (String) value);
}
}

SparkContext sparkContext = new SparkContext(conf);
return sparkContext;
}

public static boolean isEmptyString(Object val) {
return val instanceof String && ((String) val).trim().isEmpty();
}

public static String getSystemDefault(
String envName,
String propertyName,
Expand Down