Skip to content

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR is a followup of #26530 and proposes to move the configuration spark.sql.defaultUrlStreamHandlerFactory.enabled to StaticSQLConf.scala for consistency.

Why are the changes needed?

To put the similar configurations together and for readability.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Manually tested as described in #26530.

@SparkQA
Copy link

SparkQA commented Nov 18, 2019

Test build #113995 has finished for PR 26570 at commit 92c9c6d.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member Author

retest this please

@HyukjinKwon HyukjinKwon changed the title [SPARK-25694][SQL] Move 'spark.sql.defaultUrlStreamHandlerFactory.enabled' into StaticSQLConf.scala [SPARK-25694][SQL][FOLLOW-UP] Move 'spark.sql.defaultUrlStreamHandlerFactory.enabled' into StaticSQLConf.scala Nov 18, 2019
@SparkQA
Copy link

SparkQA commented Nov 18, 2019

Test build #114005 has finished for PR 26570 at commit 92c9c6d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member Author

Merged to master.

@dongjoon-hyun
Copy link
Member

Hi, @HyukjinKwon and @srowen .
There exists an on-going bug report and fix for setURLStreamHandlerFactory.

I'll backport the original SPARK-25694 and this follow-up commit to branch-2.4.

dongjoon-hyun pushed a commit that referenced this pull request May 18, 2020
…Factory.enabled' into StaticSQLConf.scala

This PR is a followup of #26530 and proposes to move the configuration `spark.sql.defaultUrlStreamHandlerFactory.enabled` to `StaticSQLConf.scala` for consistency.

To put the similar configurations together and for readability.

No.

Manually tested as described in #26530.

Closes #26570 from HyukjinKwon/SPARK-25694.

Authored-by: HyukjinKwon <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit 8469614)
Signed-off-by: Dongjoon Hyun <[email protected]>
otterc pushed a commit to linkedin/spark that referenced this pull request Mar 22, 2023
Add a property `spark.fsUrlStreamHandlerFactory.enabled` to allow users turn off the default registration of `org.apache.hadoop.fs.FsUrlStreamHandlerFactory`

This [SPARK-25694](https://issues.apache.org/jira/browse/SPARK-25694) is a long-standing issue. Originally, [[SPARK-12868][SQL] Allow adding jars from hdfs](apache#17342 ) added this for better Hive support. However, this have a side-effect when the users use Apache Spark without `-Phive`. This causes exceptions when the users tries to use another custom factories or 3rd party library (trying to set this). This configuration will unblock those non-hive users.

Yes. This provides a new user-configurable property.
By default, the behavior is unchanged.

Manual testing.

**BEFORE**
```
$ build/sbt package
$ bin/spark-shell
scala> sql("show tables").show
+--------+---------+-----------+
|database|tableName|isTemporary|
+--------+---------+-----------+
+--------+---------+-----------+

scala> java.net.URL.setURLStreamHandlerFactory(new org.apache.hadoop.fs.FsUrlStreamHandlerFactory())
java.lang.Error: factory already defined
  at java.net.URL.setURLStreamHandlerFactory(URL.java:1134)
  ... 47 elided
```

**AFTER**
```
$ build/sbt package
$ bin/spark-shell --conf spark.sql.defaultUrlStreamHandlerFactory.enabled=false
scala> sql("show tables").show
+--------+---------+-----------+
|database|tableName|isTemporary|
+--------+---------+-----------+
+--------+---------+-----------+

scala> java.net.URL.setURLStreamHandlerFactory(new org.apache.hadoop.fs.FsUrlStreamHandlerFactory())
```

Closes apache#26530 from jiangzho/master.

Lead-authored-by: Zhou Jiang <[email protected]>
Co-authored-by: Dongjoon Hyun <[email protected]>
Co-authored-by: zhou-jiang <[email protected]>
Signed-off-by: DB Tsai <[email protected]>
(cherry picked from commit ee3bd6d)

[SPARK-25694][SQL][FOLLOW-UP] Move 'spark.sql.defaultUrlStreamHandlerFactory.enabled' into StaticSQLConf.scala

This PR is a followup of apache#26530 and proposes to move the configuration `spark.sql.defaultUrlStreamHandlerFactory.enabled` to `StaticSQLConf.scala` for consistency.

To put the similar configurations together and for readability.

No.

Manually tested as described in apache#26530.

Closes apache#26570 from HyukjinKwon/SPARK-25694.

Authored-by: HyukjinKwon <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit 8469614)

RB=1906279
BUG=LIHADOOP-50577
G=superfriends-reviewers
R=zolin,yezhou,chsingh,mshen,fli,latang
A=chsingh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants