Fix CASE expression spans (#1874)

This commit is contained in:
Elia Perantoni 2025-06-06 16:06:33 +02:00 committed by GitHub
parent e2b1ae36e9
commit ff29dd25b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 9 deletions

View file

@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.
use sqlparser::ast::helpers::attached_token::AttachedToken;
use sqlparser::ast::*;
use sqlparser::dialect::{DatabricksDialect, GenericDialect};
use sqlparser::parser::ParserError;
@ -108,6 +109,8 @@ fn test_databricks_lambdas() {
Expr::Lambda(LambdaFunction {
params: OneOrManyWithParens::Many(vec![Ident::new("p1"), Ident::new("p2")]),
body: Box::new(Expr::Case {
case_token: AttachedToken::empty(),
end_token: AttachedToken::empty(),
operand: None,
conditions: vec![
CaseWhen {