Skip to content
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

[SPARK-27106][SQL] merge CaseInsensitiveStringMap and DataSourceOptions #24025

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -115,7 +115,7 @@ public Set<Map.Entry<String, String>> entrySet() {

/**
* Returns the boolean value to which the specified key is mapped,
* or defaultValue if there is no mapping for the key. The key match is case-insensitive
* or defaultValue if there is no mapping for the key. The key match is case-insensitive.
*/
public boolean getBoolean(String key, boolean defaultValue) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 4 methods are from DataSourceOptions, which are pretty general and useful.

String value = get(key);
Expand All @@ -133,7 +133,7 @@ public boolean getBoolean(String key, boolean defaultValue) {

/**
* Returns the integer value to which the specified key is mapped,
* or defaultValue if there is no mapping for the key. The key match is case-insensitive
* or defaultValue if there is no mapping for the key. The key match is case-insensitive.
*/
public int getInt(String key, int defaultValue) {
String value = get(key);
Expand All @@ -142,7 +142,7 @@ public int getInt(String key, int defaultValue) {

/**
* Returns the long value to which the specified key is mapped,
* or defaultValue if there is no mapping for the key. The key match is case-insensitive
* or defaultValue if there is no mapping for the key. The key match is case-insensitive.
*/
public long getLong(String key, long defaultValue) {
String value = get(key);
Expand All @@ -151,7 +151,7 @@ public long getLong(String key, long defaultValue) {

/**
* Returns the double value to which the specified key is mapped,
* or defaultValue if there is no mapping for the key. The key match is case-insensitive
* or defaultValue if there is no mapping for the key. The key match is case-insensitive.
*/
public double getDouble(String key, double defaultValue) {
String value = get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class RateStreamMicroBatchStream(

override def toString: String = s"RateStreamV2[rowsPerSecond=$rowsPerSecond, " +
s"rampUpTimeSeconds=$rampUpTimeSeconds, " +
s"numPartitions=${options.get(NUM_PARTITIONS).orElse("default")}"
s"numPartitions=${Option(options.get(NUM_PARTITIONS)).getOrElse("default")}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: options.getOrDefault(NUM_PARTITIONS, "default")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too minor to update...Hopefully this time all tests are passed.

}

case class RateStreamMicroBatchInputPartition(
Expand Down