aoyuEra commented on PR #284: URL: https://github.com/apache/doris-spark-connector/pull/284#issuecomment-2742446937
这个测试用例,我看了,我这里也尝试写了了一下发现对于CASW_WHEN和后面调整的函数一类的问题测试起来比较麻烦,无法创建NamedReference,这个是有包范围使用限制,所以,我这里基本上都是打包后,在spark应用中调用测试。 ---- 回复的原邮件 ---- | 发件人 | ***@***.***> | | 发送日期 | 2025年3月21日 14:09 | | 收件人 | ***@***.***> | | 主题 | 回复: [apache/doris-spark-connector] [fix](connector)修复spark doris catalog模式下,where条件有case when时报错问题(#282) (PR #284) | 我打包后,在spark应用工程中测试了,没有添加test单元测试例子 ---- 回复的原邮件 ---- | 发件人 | ***@***.***> | | 发送日期 | 2025年3月21日 14:06 | | 收件人 | ***@***.***> | | 抄送人 | ***@***.***>, ***@***.***> | | 主题 | Re: [apache/doris-spark-connector] [fix](connector)修复spark doris catalog模式下,where条件有case when时报错问题(#282) (PR #284) | @JNSimba commented on this pull request. In spark-doris-connector/spark-doris-connector-spark-3.5/src/main/scala/org/apache/doris/spark/read/expression/V2ExpressionBuilder.scala: > + case "CASE_WHEN" => + val fragment = new StringBuilder("CASE ") + val expressions = e.children() + + for(i<- 0 until expressions.size - 1 by 2){ + fragment.append(s" WHEN ${build(expressions(i))} THEN ${build(expressions(i+1))} ") + } + + if (expressions.length % 2 != 0) { + val last = expressions(expressions.length - 1) + fragment.append(s" ELSE ${build(last)} ") + } + fragment.append(" END") + + fragment.mkString Can you add a test for this? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***> -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org