tyrchen / geektime-rust

我的极客时间 Rust 课程的代码仓库,随课程更新

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the 5_queryer error happened with the polars 0.26 AND sqlparser = 0.30

eruca opened this issue · comments

commented

升级了依赖后,出现了一些错误,能fix 一下吗?

error[E0308]: mismatched types
   --> queryer/src/convert.rs:95:39
    |
95  |                 Box::new(Expr::Column(Arc::new(id.to_string()))),
    |                          ------------ ^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found struct `std::string::String`
    |                          |
    |                          arguments to this enum variant are incorrect
    |
    = note: expected struct `std::sync::Arc<str>`
               found struct `std::sync::Arc<std::string::String>`
note: tuple variant defined here
   --> /Users/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/polars-plan-0.26.1/src/dsl/expr.rs:280:5
    |
280 |     Column(Arc<str>),
    |     ^^^^^^

error[E0308]: mismatched types
   --> queryer/src/convert.rs:96:17
    |
94  |             } => Ok(Expr::Alias(
    |                     ----------- arguments to this enum variant are incorrect
95  |                 Box::new(Expr::Column(Arc::new(id.to_string()))),
96  |                 Arc::new(alias.to_string()),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found struct `std::string::String`
    |
    = note: expected struct `std::sync::Arc<str>`
               found struct `std::sync::Arc<std::string::String>`
note: tuple variant defined here
   --> /Users/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/polars-plan-0.26.1/src/dsl/expr.rs:279:5
    |
279 |     Alias(Box<Expr>, Arc<str>),
    |     ^^^^^

error[E0599]: no variant or associated item named `Wildcard` found for enum `sqlparser::ast::Expr` in the current scope
   --> queryer/src/convert.rs:116:22
    |
116 |             SqlExpr::Wildcard => Ok(Self::Wildcard),
    |                      ^^^^^^^^ variant or associated item not found in `sqlparser::ast::Expr`

error[E0599]: no variant or associated item named `IsNull` found for enum `polars::prelude::Expr` in the current scope
   --> queryer/src/convert.rs:117:47
    |
117 |             SqlExpr::IsNull(expr) => Ok(Self::IsNull(Box::new(Expression(expr).try_into()?))),
    |                                               ^^^^^^ variant or associated item not found in `polars::prelude::Expr`

error[E0599]: no variant or associated item named `IsNotNull` found for enum `polars::prelude::Expr` in the current scope
   --> queryer/src/convert.rs:118:50
    |
118 |             SqlExpr::IsNotNull(expr) => Ok(Self::IsNotNull(Box::new(Expression(expr).try_into()?))),
    |                                                  ^^^^^^^^^ variant or associated item not found in `polars::prelude::Expr`

error[E0308]: mismatched types
   --> queryer/src/convert.rs:119:56
    |
119 |             SqlExpr::Identifier(id) => Ok(Self::Column(Arc::new(id.value))),
    |                                           ------------ ^^^^^^^^^^^^^^^^^^ expected `str`, found struct `std::string::String`
    |                                           |
    |                                           arguments to this enum variant are incorrect
    |
    = note: expected struct `std::sync::Arc<str>`
               found struct `std::sync::Arc<std::string::String>`