Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Exception when there is unix_timestamp in CaseWhen #1034

Closed
jackylee-ch opened this issue Jul 19, 2022 · 1 comment
Closed

Exception when there is unix_timestamp in CaseWhen #1034

jackylee-ch opened this issue Jul 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jackylee-ch
Copy link
Contributor

Describe the bug

java.lang.ClassCastException: org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute cannot be cast to org.apache.spark.sql.catalyst.expressions.AttributeReference
	at com.intel.oap.expression.ConverterUtils$.getResultAttrFromExpr(ConverterUtils.scala:412)
	at com.intel.oap.expression.ConverterUtils$.getResultAttrFromExpr(ConverterUtils.scala:378)
	at com.intel.oap.expression.ColumnarCaseWhen.$anonfun$doColumnarCodeGen$7(ColumnarCaseWhenOperator.scala:73)
	at scala.collection.immutable.List.map(List.scala:297)
	at com.intel.oap.expression.ColumnarCaseWhen.doColumnarCodeGen(ColumnarCaseWhenOperator.scala:73)
	at com.intel.oap.expression.ColumnarAlias.doColumnarCodeGen(ColumnarNamedExpressions.scala:39)
	at com.intel.oap.expression.ColumnarConditionProjector$.$anonfun$init$3(ColumnarConditionProjector.scala:371)

To Reproduce
WSCG is set to true, and the example code is bellow.

select case when a="0" then b else unix_timestamp(a, 'yyyy-MM-dd HH:mm:ss') end time from table limit 10;

Expected behavior
No Exception thrown.

Additional context
None

@PHILO-HE
Copy link
Collaborator

Fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants