Fokko commented on a change in pull request #28754:
URL: https://github.com/apache/spark/pull/28754#discussion_r439084690
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
##########
@@ -40,10 +40,17 @@ case class Average(child: Expression) extends
DeclarativeAggregate with Implicit
override def children: Seq[Expression] = child :: Nil
- override def inputTypes: Seq[AbstractDataType] = Seq(NumericType)
+ override def inputTypes: Seq[AbstractDataType] = Seq(NumericType, DateType)
Review comment:
For Avro it is milliseconds since epoch:
https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/reflect/DateAsLongEncoding.java
For Parquet it is days since epoch:
https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#date
Also ORC is based around days since Epoch:
https://github.com/apache/orc/blob/master/java/core/src/java/org/threeten/extra/chrono/HybridDate.java
Also with this, we keep parity with the Catalyst type :)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]