Coder Social home page Coder Social logo

tyrchen / geektime-rust Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 330.0 8.87 MB

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

License: Apache License 2.0

C 0.45% Rust 95.21% Python 0.04% Go 0.09% TypeScript 0.01% C++ 0.05% Swift 1.79% Kotlin 1.42% Makefile 0.13% Jupyter Notebook 0.70% Jinja 0.11%

geektime-rust's Introduction

geektime-rust

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

rust 第一课

geektime-rust's People

Contributors

ma233 avatar tyrchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geektime-rust's Issues

06_queryer执行报错queryer-js

按README.md:

const q = require('.');
const sql = const sql = q.example_sql()
console.log(q.query(sql)); // 报`Uncaught TypeError: not enough arguments`

改用console.log(q.query(sql,"csv"))正常.

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

升级了依赖后,出现了一些错误,能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>`

bug: HTTPie

image

rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)

06 queryer examples covid Segmentation fault

OS: Windows 10
cargo 1.76.0 (c84b36747 2024-01-18)

Running `D:\src\geektime-rust\target\debug\examples\covid.exe`
DataSet(shape: (0, 5)
error: process didn't exit successfully: `D:\src\geektime-rust\target\debug\examples\covid.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
Segmentation fault

downgrade rust to 1.75.0 or upgrade polars to 0.37.0 fix the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.