[
https://issues.apache.org/jira/browse/SPARK-40563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vadim updated SPARK-40563:
--------------------------
Description:
Hello!
The Spark SQL phase optimization failed with an internal error. Please, fill a
bug report in, and provide the full stack trace.
- Spark verison 3.3.0
- Scala version 2.12
- DatasourceV2
- Postgres
- Postrgres JDBC Driver: 42+
- Java8
Case:
select
case
when (t_name = 'foo') then 'foo'
else 'default'
end as case_when
from
t
where
case
when (t_name = 'foo') then 'foo'
else 'default'
end *= 'foo'; -> works as expected*
*----------------------------------------------------------*
select
case
when (t_name = 'foo') then 'foo'
else 'default'
end as case_when
from
t
where
case
when (t_name = 'foo') then 'foo'
else 'default'
end *= 'default'; -> query throw ex;*
In where clause when we try find rows by else branch, spark thrown exception:
The Spark SQL phase optimization failed with an internal error. Please, fill a
bug report in, and provide the full stack trace.
Caused by: java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:208)
org.apache.spark.sql.execution.datasources.v2.PushablePredicate.$anonfun$unapply$1(DataSourceV2Strategy.scala:589)
At debugger def unapply in PushablePredicate.class
when sql case return 'foo' -> function unapply accept: (t_name = 'foo'), as
instance of Predicate
when sql case return 'default' -> function unapply accept: COALESCE(t_name =
'foo', FALSE) as instance of GeneralScalarExpression and assertation failed
with error
was:
Hello!
The Spark SQL phase optimization failed with an internal error. Please, fill a
bug report in, and provide the full stack trace.
- Spark verison 3.3.0
- Scala version 2.12
- DatasourceV2
- Postgres
- Postrgres JDBC Driver: 42+
- Java8
Case:
select
case
when (t_name = 'foo') then 'foo'
else 'else_will_throw_ex'
end as case_when
from
t
where
case
when (t_name = 'foo') then 'foo'
else 'defualt_name'
end *= 'foo'; -> works as expected*
*----------------------------------------------------------*
select
case
when (t_name = 'foo') then 'foo'
else 'else_will_throw_ex'
end as case_when
from
t
where
case
when (t_name = 'foo') then 'foo'
else 'defualt_name'
end *= 'defualt_name'; -> query throw ex;*
In where clause when we try find rows by else branch, spark thrown exception:
The Spark SQL phase optimization failed with an internal error. Please, fill a
bug report in, and provide the full stack trace.
Caused by: java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:208)
org.apache.spark.sql.execution.datasources.v2.PushablePredicate.$anonfun$unapply$1(DataSourceV2Strategy.scala:589)
At debugger def unapply in PushablePredicate.class
when sql case return 'foo' -> function unapply accept: (t_name#1 = foo), as
instance of Predicate
when sql case return 'else_will_throw_ex' -> function unapply accept:
COALESCE(t_name = 'foo', FALSE) as instance of GeneralScalarExpression and
assertation failed with error
> Error at where clause, when sql case executes by else branch
> ------------------------------------------------------------
>
> Key: SPARK-40563
> URL: https://issues.apache.org/jira/browse/SPARK-40563
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.3.0
> Reporter: Vadim
> Priority: Major
> Fix For: 3.3.0
>
> Attachments: java-code-example.txt, sql.txt, stack-trace.txt
>
>
> Hello!
> The Spark SQL phase optimization failed with an internal error. Please, fill
> a bug report in, and provide the full stack trace.
> - Spark verison 3.3.0
> - Scala version 2.12
> - DatasourceV2
> - Postgres
> - Postrgres JDBC Driver: 42+
> - Java8
> Case:
> select
> case
> when (t_name = 'foo') then 'foo'
> else 'default'
> end as case_when
> from
> t
> where
> case
> when (t_name = 'foo') then 'foo'
> else 'default'
> end *= 'foo'; -> works as expected*
> *----------------------------------------------------------*
> select
> case
> when (t_name = 'foo') then 'foo'
> else 'default'
> end as case_when
> from
> t
> where
> case
> when (t_name = 'foo') then 'foo'
> else 'default'
> end *= 'default'; -> query throw ex;*
> In where clause when we try find rows by else branch, spark thrown exception:
> The Spark SQL phase optimization failed with an internal error. Please, fill
> a bug report in, and provide the full stack trace.
> Caused by: java.lang.AssertionError: assertion failed
> at scala.Predef$.assert(Predef.scala:208)
>
> org.apache.spark.sql.execution.datasources.v2.PushablePredicate.$anonfun$unapply$1(DataSourceV2Strategy.scala:589)
> At debugger def unapply in PushablePredicate.class
> when sql case return 'foo' -> function unapply accept: (t_name = 'foo'), as
> instance of Predicate
> when sql case return 'default' -> function unapply accept: COALESCE(t_name =
> 'foo', FALSE) as instance of GeneralScalarExpression and assertation failed
> with error
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]