[
https://issues.apache.org/jira/browse/SPARK-4869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ajay updated SPARK-4869:
------------------------
Description:
We got stuck with “IF-THEN” statement in Spark SQL. As per our usecase, we have
to have nested “if” statements. But, spark sql is not able to resolve the
variable names in final evaluation but the literal values are working. An
"Unresolved Attributes" error is being thrown. Please fix this bug.
This works:
sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH', 0,1)
as ROLL_BACKWARD FROM OUTER_RDD")
This doesn’t :
sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH',
0,DAYS_30) as ROLL_BACKWARD FROM OUTER_RDD")
was:
We got stuck with “IF-THEN” statement in Spark SQL. As per our usecase, we have
to have nested “if” statements. But, spark sql is not able to resolve the
variable names in final evaluation but the literal values are working. Please
fix this bug.
This works:
sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH', 0,1)
as ROLL_BACKWARD FROM OUTER_RDD")
This doesn’t :
sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH',
0,DAYS_30) as ROLL_BACKWARD FROM OUTER_RDD")
> The variable names in IF statement of Spark SQL doesn't resolve to its value.
> ------------------------------------------------------------------------------
>
> Key: SPARK-4869
> URL: https://issues.apache.org/jira/browse/SPARK-4869
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 1.1.1
> Reporter: Ajay
> Priority: Blocker
>
> We got stuck with “IF-THEN” statement in Spark SQL. As per our usecase, we
> have to have nested “if” statements. But, spark sql is not able to resolve
> the variable names in final evaluation but the literal values are working. An
> "Unresolved Attributes" error is being thrown. Please fix this bug.
> This works:
> sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH',
> 0,1) as ROLL_BACKWARD FROM OUTER_RDD")
> This doesn’t :
> sqlSC.sql("SELECT DISTINCT UNIT, PAST_DUE ,IF( PAST_DUE = 'CURRENT_MONTH',
> 0,DAYS_30) as ROLL_BACKWARD FROM OUTER_RDD")
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]