n-young commented on code in PR #60076:
URL: https://github.com/apache/spark/pull/60076#discussion_r4486144388


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -465,6 +465,16 @@ object SQLConf {
     .intConf
     .createWithDefault(100)
 
+  val HAVING_WITH_WINDOW_RESOLVES_GROUPING_COLUMN_FIRST =

Review Comment:
   The config is SESSION-bound via 
withBindingPolicy(ConfigBindingPolicy.SESSION).



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -465,6 +465,17 @@ object SQLConf {
     .intConf
     .createWithDefault(100)
 
+  val HAVING_WITH_WINDOW_RESOLVES_GROUPING_COLUMN_FIRST =
+    
buildConf("spark.sql.analyzer.havingWithWindowResolvesGroupingColumnFirst.enabled")
+      .internal()
+      .withBindingPolicy(ConfigBindingPolicy.SESSION)
+      .doc("When true, preserve HAVING name-resolution scope during window 
extraction so that " +
+        "grouping columns take precedence over SELECT aliases. When false, 
retain the legacy " +
+        "SELECT-alias precedence after window extraction.")
+      .version("4.4.0")
+      .booleanConf
+      .createWithDefault(false)

Review Comment:
   Keeping false deliberately because name binding is compatibility-sensitive: 
existing queries can depend on SELECT-alias precedence. The description now 
states this explicitly and links SPARK-60861. Enabling the default needs a 
separate compatibility decision; no rollout date is being promised. The 
independent nested-window correction remains the default behavior inherited 
from #60090.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -465,6 +465,17 @@ object SQLConf {
     .intConf
     .createWithDefault(100)
 
+  val HAVING_WITH_WINDOW_RESOLVES_GROUPING_COLUMN_FIRST =
+    
buildConf("spark.sql.analyzer.havingWithWindowResolvesGroupingColumnFirst.enabled")
+      .internal()
+      .withBindingPolicy(ConfigBindingPolicy.SESSION)
+      .doc("When true, preserve HAVING name-resolution scope during window 
extraction so that " +

Review Comment:
   Expanded the config documentation to describe its grouping-set placement and 
original aggregate-input scope, plus the legacy disabled path. General 
nested-window and generator placement now comes independently from #60090 
rather than this flag.



-- 
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]

Reply via email to