Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.sql.connector

import org.apache.spark.SparkConf
import org.apache.spark.sql.QueryTest
import org.apache.spark.sql.catalyst.expressions.{Cast, Literal}
import org.apache.spark.sql.connector.expressions.filter.{AlwaysTrue, Predicate => V2Predicate}
Expand All @@ -27,6 +28,8 @@ import org.apache.spark.sql.types.BooleanType

class PushablePredicateSuite extends QueryTest with SharedSparkSession {

override def sparkConf: SparkConf = super.sparkConf.set(SQLConf.ANSI_ENABLED, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, shouldn't we better explicitly enable it for affected test cases only? Either works fine to me. I opened one in #51330 so you can merge either this or that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it for convenience, as DS v2 expressions follow ANSI and we can only translate catalyst expressions (if they are ANSI relevent) into DS v2 expressions if ANSI is enabled. All DS v2 tests should enable ANSI mode.


test("simple boolean expression should always return v2 Predicate") {
Seq(true, false).foreach { createV2Predicate =>
Seq(true, false).foreach { noAssert =>
Expand Down