-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18817] [SPARKR] [SQL] Set default warehouse dir to tempdir #16290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ac05089
2583410
1d0d1d2
014d7e1
6eec97d
f7b4772
047054e
b14c302
7a98b91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,16 +222,60 @@ class SQLConfSuite extends QueryTest with SharedSQLContext { | |
| } | ||
|
|
||
| test("changing default value of warehouse path") { | ||
|
||
| // Set sql.default.warehouse.dir but not sql.warehouse.dir | ||
| try { | ||
| val newWarehouseDefault = "spark-warehouse2" | ||
| val newWarehouseDefaultPath = new Path(Utils.resolveURI(newWarehouseDefault)).toString | ||
| sparkContext.conf.set("spark.sql.default.warehouse.dir", newWarehouseDefaultPath) | ||
| val spark = new SparkSession(sparkContext) | ||
| assert(newWarehouseDefaultPath.stripSuffix("/") === spark | ||
| .sessionState.conf.warehousePath.stripSuffix("/")) | ||
|
||
| assert(newWarehouseDefaultPath.stripSuffix("/") === spark | ||
| .sharedState.warehousePath.stripSuffix("/")) | ||
| } finally { | ||
| sparkContext.conf.remove("spark.sql.default.warehouse.dir") | ||
| } | ||
|
|
||
| // Set sql.warehouse.dir and sql.default.warehouse.dir. The first one should be used | ||
| try { | ||
| val newWarehouseDefault = "spark-warehouse2" | ||
| val newWarehouseDefaultPath = new Path(Utils.resolveURI(newWarehouseDefault)).toString | ||
| sparkContext.conf.set("spark.sql.default.warehouse.dir", newWarehouseDefaultPath) | ||
|
|
||
| val newWarehouse = "spark-warehouse3" | ||
| val newWarehousePath = new Path(Utils.resolveURI(newWarehouse)).toString | ||
| sparkContext.conf.set("spark.sql.warehouse.dir", newWarehousePath) | ||
| val spark = new SparkSession(sparkContext) | ||
| assert(newWarehousePath.stripSuffix("/") === spark | ||
| .sessionState.conf.warehousePath.stripSuffix("/")) | ||
| assert(newWarehousePath.stripSuffix("/") === spark | ||
| .sharedState.warehousePath.stripSuffix("/")) | ||
| } finally { | ||
| sparkContext.conf.remove("spark.sql.default.warehouse.dir") | ||
| sparkContext.conf.remove("spark.sql.warehouse.dir") | ||
| } | ||
|
|
||
| // Set sql.warehouse.dir but not sql.default.warehouse.dir | ||
| try { | ||
| val newWarehouse = "spark-warehouse4" | ||
| val newWarehousePath = new Path(Utils.resolveURI(newWarehouse)).toString | ||
| sparkContext.conf.set("spark.sql.warehouse.dir", newWarehousePath) | ||
| val spark = new SparkSession(sparkContext) | ||
| assert(newWarehousePath.stripSuffix("/") === spark | ||
| .sessionState.conf.warehousePath.stripSuffix("/")) | ||
| assert(newWarehousePath.stripSuffix("/") === spark | ||
| .sharedState.warehousePath.stripSuffix("/")) | ||
| } finally { | ||
| sparkContext.conf.remove("spark.sql.warehouse.dir") | ||
| } | ||
|
|
||
| // Set neither of the two configs. The default value should be "spark-warehouse" | ||
|
|
||
| val spark = new SparkSession(sparkContext) | ||
| assert(new Path(Utils.resolveURI("spark-warehouse")).toString.stripSuffix("/") === spark | ||
| .sessionState.conf.warehousePath.stripSuffix("/")) | ||
| assert(new Path(Utils.resolveURI("spark-warehouse")).toString.stripSuffix("/") === spark | ||
| .sharedState.warehousePath.stripSuffix("/")) | ||
| } | ||
|
|
||
| test("MAX_CASES_BRANCHES") { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make it internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with this part of the code base - What are the consequences of making it internal ? Is it just in terms of what shows up in documentation or does it affect how users can use it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the internal configuration, it will not be printed out. For example, you can try something like