WweiL commented on code in PR #45888:
URL: https://github.com/apache/spark/pull/45888#discussion_r1556983746
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveTimeWindows.scala:
##########
@@ -93,17 +93,38 @@ object TimeWindowing extends Rule[LogicalPlan] {
}
}
+ // scalastyle:off
+ println("wei-== resolveTimeWindows, window: " + window)
+ println("wei-== resolveTimeWindows, window.timeColumn: " +
window.timeColumn)
+ println("wei-== resolveTimeWindows, window.timeColumn.dataType: " +
window.timeColumn.dataType)
+ println("wei-== resolveTimeWindows, window.timeColumn class: " +
window.timeColumn.getClass)
+// println("wei-== resolveTimeWindows, window.timeColumn child: " +
window.timeColumn.child)
+// println("wei-== resolveTimeWindows, window.timeColumn output
metadata: " + window.timeColumn.output.map(_.metadata))
+
+
val metadata = window.timeColumn match {
case a: Attribute => a.metadata
+// case e: Cast => println("wei== Cast child: " + e.child + " child
type: " + e.child.getClass); Metadata.empty
case _ => Metadata.empty
}
- val newMetadata = new MetadataBuilder()
+
+ val newMetadataBuilder = new MetadataBuilder()
.withMetadata(metadata)
.putBoolean(TimeWindow.marker, true)
- .build()
+
+ // for each child output metadata, also add it here
+ child.output.map(_.metadata).foreach { m =>
+ newMetadataBuilder.withMetadata(m)
+ }
Review Comment:
looks like a hack now
--
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]