Github user jiangxb1987 commented on a diff in the pull request:
https://github.com/apache/spark/pull/18540#discussion_r129000692
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/trees/TreeNodeSuite.scala
---
@@ -436,21 +436,22 @@ class TreeNodeSuite extends SparkFunSuite {
"bucketColumnNames" -> "[bucket]",
"sortColumnNames" -> "[sort]"))
- // Converts FrameBoundary to JSON
- assertJSON(
- ValueFollowing(3),
- JObject(
- "product-class" -> classOf[ValueFollowing].getName,
- "value" -> 3))
-
// Converts WindowFrame to JSON
assertJSON(
- SpecifiedWindowFrame(RowFrame, UnboundedFollowing, CurrentRow),
- JObject(
- "product-class" -> classOf[SpecifiedWindowFrame].getName,
- "frameType" -> JObject("object" ->
JString(RowFrame.getClass.getName)),
- "frameStart" -> JObject("object" ->
JString(UnboundedFollowing.getClass.getName)),
- "frameEnd" -> JObject("object" ->
JString(CurrentRow.getClass.getName))))
+ SpecifiedWindowFrame(RowFrame, Unbounded, CurrentRow),
+ List(
+ JObject(
+ "class" -> classOf[SpecifiedWindowFrame].getName,
+ "num-children" -> 2,
+ "frameType" -> JObject("object" ->
JString(RowFrame.getClass.getName)),
+ "lower" -> 0,
+ "upper" -> 1),
--- End diff --
After this PR, `SpecialFrameBoundary` and `WindowFrame` are made
`Expression`s, thus they are `TreeNode`s, so the field values are made value
index in the TreeNode.children.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]