This is an automated email from the ASF dual-hosted git repository.
srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 18488158bee [SQL][MINOR] Use Diamond operator for constructing HashMap
18488158bee is described below
commit 18488158beee5435f99899f99b2e90fb6e37f3d5
Author: Ted Yu <[email protected]>
AuthorDate: Thu Dec 29 08:07:50 2022 -0600
[SQL][MINOR] Use Diamond operator for constructing HashMap
### What changes were proposed in this pull request?
This PR uses Diamond operator for constructing HashMap and Tuple2 for type
inference.
### Why are the changes needed?
The change follows Java practices for creating new HashMap.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing test suite.
Closes #39250 from tedyu/hash-map.
Authored-by: Ted Yu <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
---
.../test/org/apache/spark/sql/JavaBeanDeserializationSuite.java | 6 +++---
.../java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java
b/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java
index da626b4d873..66c985bdda0 100644
---
a/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java
+++
b/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java
@@ -590,9 +590,9 @@ public class JavaBeanDeserializationSuite implements
Serializable {
.reduceGroups(rf);
List<Tuple2<String, Item>> expectedRecords = Arrays.asList(
- new Tuple2("a", new Item("a", 8)),
- new Tuple2("b", new Item("b", 3)),
- new Tuple2("c", new Item("c", 2)));
+ new Tuple2<>("a", new Item("a", 8)),
+ new Tuple2<>("b", new Item("b", 3)),
+ new Tuple2<>("c", new Item("c", 2)));
List<Tuple2<String, Item>> result = finalDs.collectAsList();
diff --git
a/sql/core/src/test/java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java
b/sql/core/src/test/java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java
index 1836cc403c3..bee77616b7e 100644
---
a/sql/core/src/test/java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java
+++
b/sql/core/src/test/java/test/org/apache/spark/sql/JavaColumnExpressionSuite.java
@@ -86,7 +86,7 @@ public class JavaColumnExpressionSuite {
AnalysisException e = Assert.assertThrows(AnalysisException.class,
() -> df.filter(df.col("a").isInCollection(Arrays.asList(new
Column("b")))));
Assert.assertTrue(e.getErrorClass().equals("DATATYPE_MISMATCH.DATA_DIFF_TYPES"));
- Map<String, String> messageParameters = new HashMap();
+ Map<String, String> messageParameters = new HashMap<>();
messageParameters.put("functionName", "`in`");
messageParameters.put("dataType", "[\"INT\", \"ARRAY<INT>\"]");
messageParameters.put("sqlExpr", "\"(a IN (b))\"");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]