cloud-fan commented on a change in pull request #35735:
URL: https://github.com/apache/spark/pull/35735#discussion_r821294951
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/HistogramNumericSuite.scala
##########
@@ -151,6 +181,80 @@ class HistogramNumericSuite extends SparkFunSuite {
assert(agg.eval(buffer) != null)
}
+ test("class HistogramNumeric, exercise many different numeric input types") {
+ val inputs = Seq(
+ (Literal(0),
+ Literal(1),
+ Literal(2)),
+ (Literal(0L),
+ Literal(1L),
+ Literal(2L)),
+ (Literal(0.toShort),
+ Literal(1.toShort),
+ Literal(2.toShort)),
+ (Literal(0F),
+ Literal(1F),
+ Literal(2F)),
+ (Literal(0D),
+ Literal(1D),
+ Literal(2D)),
+ (Literal(Timestamp.valueOf("2017-03-01 00:00:00")),
+ Literal(Timestamp.valueOf("2017-03-02 00:00:00")),
+ Literal(Timestamp.valueOf("2017-03-03 00:00:00"))),
+ (Literal(Duration.ofSeconds(1111)),
+ Literal(Duration.ofSeconds(1211)),
+ Literal(Duration.ofSeconds(1311))),
+ (Literal(Period.ofMonths(10)),
+ Literal(Period.ofMonths(11)),
+ Literal(Period.ofMonths(12))))
+ for ((left, middle, right) <- inputs) {
+ // Check that the 'propagateInputType' bit correctly toggles the output
type.
+ SQLConf.withExistingConf(
+ new SQLConf().copy(SQLConf.HISTOGRAM_NUMERIC_PROPAGATE_INPUT_TYPE ->
false)) {
Review comment:
in the test, we can just use `withSQLConf(...)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]