mihailoale-db opened a new pull request, #52092:
URL: https://github.com/apache/spark/pull/52092

   ### What changes were proposed in this pull request?
   I propose that we always store ANSI value when creating a view because 
otherwise users can be affected by unwanted behavior. For example if user 
creates a view on version that has ANSI = false by default he expects this not 
to fail.
   
   ```
   CREATE VIEW view AS SELECT CAST('abc' AS INT) AS a;
   SELECT * FROM view;
   ```
   
   But if user queries the view on the version which has ANSI = true by 
default, above query is going to fail (because when we don't store the value, 
and we store it only if explicitly set, we use the default one). Number of this 
and similar use cases is huge, because ANSI impact area is huge and thus I 
propose that we always store the value.
   
   If the value is not stored, I propose that we use createVersion field to 
determine whether the ANSI value should be true (Spark 4.0.0 and above) or 
false (lower than Spark 4.0.0). If the createVersion field wasn't stored during 
view creation, I propose that we assume that the ANSI = false because number of 
those views is incomparable larger than the ones expecting ANSI = true
   
   ### Why are the changes needed?
   To improve user experience.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Added suite.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to