Yang Jie created SPARK-60456:
--------------------------------
Summary: Limit spark.sql.legacy.earlyEvalCurrentTime in
ResolveTableSpec to OPTIONS values
Key: SPARK-60456
URL: https://issues.apache.org/jira/browse/SPARK-60456
Project: Spark
Issue Type: Improvement
Components: SQL
Affects Versions: 5.0.0
Reporter: Yang Jie
With spark.sql.legacy.earlyEvalCurrentTime=true, ResolveTableSpec runs
ComputeCurrentTime(ResolveTimeZone(plan)) during analysis on any plan that
contains a command. The branch exists for OPTIONS values, but it rewrites the
whole command. So an ALTER TABLE ... ADD CONSTRAINT ... CHECK (ts <=
current_timestamp()) has its condition folded before SPARK-60032 can tell that
it reads the current time, and the stored predicate compares ts with the time
of the ALTER TABLE.
The flag is documented as sacrificing correctness, so this is low priority.
Narrowing the branch to the OPTIONS values would keep it from reaching other
expressions of the command.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]