You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by skambha <gi...@git.apache.org> on 2017/12/05 23:31:30 UTC
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
GitHub user skambha opened a pull request:
https://github.com/apache/spark/pull/19902
[SPARK-22452][SQL]Add getInt, getLong, getBoolean to DataSourceV2Options
- Implemented methods getInt, getLong, getBoolean for DataSourceV2Options
- Added new unit tests to exercise these methods
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/skambha/spark spark22452
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19902.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #19902
----
commit 566b7a5274bef77d1a786663bfe908f3e8dc9892
Author: Sunitha Kambhampati <sk...@us.ibm.com>
Date: 2017-12-05T22:29:52Z
Add getInt, getLong, getBoolean to DataSourceV2Options and add unit tests
commit bb01ff5ad214356a6bfdbebc36f1a7b2f37a46f1
Author: Sunitha Kambhampati <sk...@us.ibm.com>
Date: 2017-12-05T22:40:23Z
Fix formatting
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155389138
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,22 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public Optional<Boolean> getBoolean(String key) {
--- End diff --
Per @gatorsmile , I have gone and removed the version of the methods that doesn't take the default value.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84578 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84578/testReport)** for PR 19902 at commit [`15e8ce5`](https://github.com/apache/spark/commit/15e8ce584180d014f8b1ffeb8f0e251299cb8f31).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155389363
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,23 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
--- End diff --
> /** Get a parameter as a boolean, falling back to a default if not set */
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155387709
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,41 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public Optional<Boolean> getBoolean(String key) {
+ String lcaseKey = toLowerCase(key);
+ return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
+ Boolean.parseBoolean(keyLowerCasedMap.get(lcaseKey)) : null);
+ }
+
+ public Optional<Integer> getInt(String key) {
+ String lcaseKey = toLowerCase(key);
+ return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
+ Integer.parseInt(keyLowerCasedMap.get(lcaseKey)) : null);
+ }
+
+ public Optional<Long> getLong(String key) {
--- End diff --
Can you also remove the three APIs without the default values?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155394195
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,23 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
--- End diff --
Thanks. Is it ok if I modify the comment a bit to this:
/**
* Returns the integer value to which the specified key is mapped,
* or defaultValue if this map contains no mapping for the key.
* The key match is case-insensitive
*/
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84582 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84582/testReport)** for PR 19902 at commit [`7d87edc`](https://github.com/apache/spark/commit/7d87edcccc0573554b6b43e0cac17994652397bb).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84578/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on the issue:
https://github.com/apache/spark/pull/19902
great! Thanks @gatorsmile for your comments.
I have updated with code comments, please take a look. Thanks.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/19902
LGTM except three comments.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:
https://github.com/apache/spark/pull/19902
ah i see, yea looks like `getByte`, `getShort` won't be very useful, let's add `getDouble`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84582/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84579 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84579/testReport)** for PR 19902 at commit [`5de7962`](https://github.com/apache/spark/commit/5de7962755f2175d6d11dec262644e8b9afae08b).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on the issue:
https://github.com/apache/spark/pull/19902
cool! I will add that and submit a new PR.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155225855
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,22 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public Optional<Boolean> getBoolean(String key) {
--- End diff --
to avoid the expensive boxing, how about `public boolean getBoolean(String key, boolean defaultValue)`? This is also consistent with SparkCong.getXXX
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84582 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84582/testReport)** for PR 19902 at commit [`7d87edc`](https://github.com/apache/spark/commit/7d87edcccc0573554b6b43e0cac17994652397bb).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155388109
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,41 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public Optional<Boolean> getBoolean(String key) {
+ String lcaseKey = toLowerCase(key);
+ return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
+ Boolean.parseBoolean(keyLowerCasedMap.get(lcaseKey)) : null);
+ }
+
+ public Optional<Integer> getInt(String key) {
+ String lcaseKey = toLowerCase(key);
+ return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
+ Integer.parseInt(keyLowerCasedMap.get(lcaseKey)) : null);
+ }
+
+ public Optional<Long> getLong(String key) {
--- End diff --
Sure. Let me post another commit. Thanks.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155389433
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,23 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public boolean getBoolean(String key, boolean defaultValue) {
+ String lcaseKey = toLowerCase(key);
+ return keyLowerCasedMap.containsKey(lcaseKey) ?
+ Boolean.parseBoolean(keyLowerCasedMap.get(lcaseKey)) : defaultValue;
+ }
+
+ public int getInt(String key, int defaultValue) {
+ String lcaseKey = toLowerCase(key);
+ return keyLowerCasedMap.containsKey(lcaseKey) ?
+ Integer.parseInt(keyLowerCasedMap.get(lcaseKey)) : defaultValue;
+ }
+
+ public long getLong(String key, long defaultValue) {
--- End diff --
/** Get a parameter as a long, falling back to a default if not set */
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84579 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84579/testReport)** for PR 19902 at commit [`5de7962`](https://github.com/apache/spark/commit/5de7962755f2175d6d11dec262644e8b9afae08b).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84514 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84514/testReport)** for PR 19902 at commit [`bb01ff5`](https://github.com/apache/spark/commit/bb01ff5ad214356a6bfdbebc36f1a7b2f37a46f1).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Can one of the admins verify this patch?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/19902
ok to test
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155387973
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,22 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public Optional<Boolean> getBoolean(String key) {
--- End diff --
good idea.
1. So I have implemented the getBoolean, getInt, and getLong using the defaultValue and added unit tests for it.
2. For now, I have left the other methods as well that return Optional<> keeping in line with the getString as it may still have some value.
Please take a look.
If we don't want (2), I can remove the version of the getBoolean, getLong, getInt that doesn't take the defaultValue.
Thanks for your comments.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/19902
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on the issue:
https://github.com/apache/spark/pull/19902
Opened a new PR to add the getDouble method. https://github.com/apache/spark/pull/19921
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by skambha <gi...@git.apache.org>.
Github user skambha commented on the issue:
https://github.com/apache/spark/pull/19902
great! Thanks @gatorsmile , @cloud-fan.
Yes. I would be happy to open a new PR to add the rest of them.
If I compare with the getXXX types in SparkConf, it looks like the only missing one is to add getDouble. Do we want to add only that or any of the other datatypes or any other getXXX? Let me know and I would be happy to open a new PR to address it. Thank you!
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:
https://github.com/apache/spark/pull/19902
thanks, merging to master!
@skambha would you like to open a new PR to add the rest of `getXXX` methods?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84514 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84514/testReport)** for PR 19902 at commit [`bb01ff5`](https://github.com/apache/spark/commit/bb01ff5ad214356a6bfdbebc36f1a7b2f37a46f1).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19902
**[Test build #84578 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84578/testReport)** for PR 19902 at commit [`15e8ce5`](https://github.com/apache/spark/commit/15e8ce584180d014f8b1ffeb8f0e251299cb8f31).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84579/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19902#discussion_r155389404
--- Diff: sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java ---
@@ -49,4 +49,23 @@ public DataSourceV2Options(Map<String, String> originalMap) {
public Optional<String> get(String key) {
return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
}
+
+ public boolean getBoolean(String key, boolean defaultValue) {
+ String lcaseKey = toLowerCase(key);
+ return keyLowerCasedMap.containsKey(lcaseKey) ?
+ Boolean.parseBoolean(keyLowerCasedMap.get(lcaseKey)) : defaultValue;
+ }
+
+ public int getInt(String key, int defaultValue) {
--- End diff --
/** Get a parameter as an integer, falling back to a default if not set */
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19902: [SPARK-22452][SQL]Add getInt, getLong, getBoolean to Dat...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19902
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84514/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org