liukun4515 commented on code in PR #3301:
URL: https://github.com/apache/arrow-datafusion/pull/3301#discussion_r959035310
##########
datafusion/physical-expr/src/planner.rs:
##########
@@ -83,6 +83,84 @@ pub fn create_physical_expr(
}
}
}
+ Expr::IsTrue(expr) => {
+ let binary_op = binary_expr(
+ expr.as_ref().clone(),
+ Operator::IsNotDistinctFrom,
+ Expr::Literal(ScalarValue::Boolean(Some(true))),
+ );
+ create_physical_expr(
+ &binary_op,
+ input_dfschema,
+ input_schema,
+ execution_props,
+ )
+ }
+ Expr::IsNotTrue(expr) => {
+ let binary_op = binary_expr(
+ expr.as_ref().clone(),
+ Operator::IsDistinctFrom,
+ Expr::Literal(ScalarValue::Boolean(Some(true))),
+ );
+ create_physical_expr(
+ &binary_op,
+ input_dfschema,
+ input_schema,
+ execution_props,
+ )
+ }
+ Expr::IsFalse(expr) => {
+ let binary_op = binary_expr(
+ expr.as_ref().clone(),
+ Operator::IsNotDistinctFrom,
+ Expr::Literal(ScalarValue::Boolean(Some(false))),
+ );
+ create_physical_expr(
+ &binary_op,
+ input_dfschema,
+ input_schema,
+ execution_props,
+ )
+ }
+ Expr::IsNotFalse(expr) => {
+ let binary_op = binary_expr(
+ expr.as_ref().clone(),
+ Operator::IsDistinctFrom,
+ Expr::Literal(ScalarValue::Boolean(Some(false))),
+ );
+ create_physical_expr(
+ &binary_op,
+ input_dfschema,
+ input_schema,
+ execution_props,
+ )
+ }
+ Expr::IsUnknown(expr) => {
Review Comment:
I check the spark, and meet a confused result.
1. check with scalar
```
spark-sql> explain select 1 is unknown;
== Physical Plan ==
org.apache.spark.sql.AnalysisException: cannot resolve '(1 IS UNKNOWN)' due
to data type mismatch: argument 1 requires boolean type, however, '1' is of int
type.; line 1 pos 17;
'Project [unresolvedalias(anon$1(1), None)]
+- OneRowRelation
```
I think this is a bug for spark
2. check with column
```
spark-sql> desc t1;
22/08/31 08:22:24 WARN ObjectStore: Failed to get database global_temp,
returning NoSuchObjectException
c1 int
Time taken: 0.088 seconds, Fetched 1 row(s)
spark-sql> explain select c1 is unknown from t1;
== Physical Plan ==
*(1) Project [isnull(c1#53) AS (c1 IS NULL)#54]
+- Scan hive default.t1 [c1#53], HiveTableRelation [`default`.`t1`,
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, Data Cols: [c1#53],
Partition Cols: []]
```
--
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]