hemanthboyina commented on code in PR #58666:
URL: https://github.com/apache/spark/pull/58666#discussion_r4048997337
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2RelationSuite.scala:
##########
@@ -132,24 +132,57 @@ class DataSourceV2RelationSuite extends SparkFunSuite
with SQLHelper {
output)
}
+ private def optLong(value: Option[Long]): OptionalLong =
+ value.map(OptionalLong.of).getOrElse(OptionalLong.empty())
+
+ /** Builds a [[ColumnStatistics]] overriding only the fields these tests
exercise. */
Review Comment:
done
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2RelationSuite.scala:
##########
@@ -132,24 +132,57 @@ class DataSourceV2RelationSuite extends SparkFunSuite
with SQLHelper {
output)
}
+ private def optLong(value: Option[Long]): OptionalLong =
+ value.map(OptionalLong.of).getOrElse(OptionalLong.empty())
+
+ /** Builds a [[ColumnStatistics]] overriding only the fields these tests
exercise. */
+ private def columnStat(
+ distinct: Option[Long] = None,
+ avg: Option[Long] = None): ColumnStatistics = new ColumnStatistics {
+ override def distinctCount(): OptionalLong = optLong(distinct)
+ override def avgLen(): OptionalLong = optLong(avg)
+ }
+
+ /** Builds a column-stats map keyed by [[NamedReference]] from `name ->
stats` pairs. */
+ private def columnStatsMap(
+ entries: (String, ColumnStatistics)*): java.util.Map[NamedReference,
ColumnStatistics] = {
Review Comment:
done
--
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]