advancedxy commented on code in PR #42255:
URL: https://github.com/apache/spark/pull/42255#discussion_r1297919791
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameHintSuite.scala:
##########
@@ -42,43 +44,53 @@ class DataFrameHintSuite extends AnalysisTest with
SharedSparkSession {
check(
df.hint("hint1", 1, "a"),
- UnresolvedHint("hint1", Seq(1, "a"), df.logicalPlan)
+ UnresolvedHint("hint1", Seq(Literal(1), Literal("a")), df.logicalPlan)
)
check(
df.hint("hint1", 1, $"a"),
- UnresolvedHint("hint1", Seq(1, $"a"),
+ UnresolvedHint("hint1", Seq(Literal(1), $"a".expr),
df.logicalPlan
)
)
check(
- df.hint("hint1", Seq(1, 2, 3), Seq($"a", $"b", $"c")),
- UnresolvedHint("hint1", Seq(Seq(1, 2, 3), Seq($"a", $"b", $"c")),
+ df.hint("hint1", Array(1, 2, 3), array($"a", $"b", $"c")),
Review Comment:
Yeah. After this PR, we will reject the `Seq(1,2,3)` input as it cannot be
treated as a literal.
The main reason that I didn't transform Scala's `Seq` to Java's `Array` is
that we believe should align the semantics between Spark Connect and this
Dataframe's API. Spark Connect's hint method also treats input as literal,
which means `Seq(1,2,3)` doesn't work too.
If backward compatibility is important, I think both connect and this API
should all treat Seq as Array. But if we are targeting 4.0, I think we may have
the chance to introduce som breaking changes.
--
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]