Skip to content

Commit 1970254

Browse files
committed
Address comments
1 parent 1e4d5c1 commit 1970254

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import org.apache.spark.sql.execution.CacheManager
3636
import org.apache.spark.sql.execution.streaming.StreamExecution
3737
import org.apache.spark.sql.execution.ui.{SQLAppStatusListener, SQLAppStatusStore, SQLTab}
3838
import org.apache.spark.sql.internal.StaticSQLConf._
39+
import org.apache.spark.sql.internal.config.DEFAULT_URL_STREAM_HANDLER_FACTORY_ENABLED
3940
import org.apache.spark.sql.streaming.StreamingQuery
4041
import org.apache.spark.status.ElementTrackingStore
4142
import org.apache.spark.util.Utils
@@ -202,7 +203,7 @@ object SharedState extends Logging {
202203
"so it can not be modified")
203204
case None => synchronized {
204205
try {
205-
if (conf.getBoolean("spark.fsUrlStreamHandlerFactory.enabled", true)) {
206+
if (conf.get(DEFAULT_URL_STREAM_HANDLER_FACTORY_ENABLED)) {
206207
URL.setURLStreamHandlerFactory(defaultFactory)
207208
factory = Some(defaultFactory)
208209
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.spark.sql.internal
19+
20+
import org.apache.spark.internal.config.ConfigBuilder
21+
22+
package object config {
23+
24+
private[spark] val DEFAULT_URL_STREAM_HANDLER_FACTORY_ENABLED =
25+
ConfigBuilder("spark.sql.defaultUrlStreamHandlerFactory.enabled")
26+
.doc("When true, set FsUrlStreamHandlerFactory to support ADD JAR against HDFS locations")
27+
.booleanConf
28+
.createWithDefault(true)
29+
}

0 commit comments

Comments
 (0)