- 
                Notifications
    You must be signed in to change notification settings 
- Fork 666
Support parsing double equal #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @eddyxu can you please add to the PR description: 
 Thanks :) | 
| +1, I'm curious about the usage scenario. Can't a single equal sign meet the demand? | 
| Sure thing @AugustoFKL and @xudong963 We were trying to implement predicate pushdown from pyarrow to  ❯ python3
Python 3.10.10 (main, Feb 16 2023, 02:49:39) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyarrow.compute as pc
>>> filter_expr = pa.compute.field("a") == 10
>>> str(filter_expr)
'(a == 10)'I dont have a particular Dialect in mind actually, but I saw that  | 
| @eddyxu @AugustoFKL the only database I'm aware of that supports  Have you thought about writing something like  | 
| @ankrgyl that's fair.    Putting aside of the dialect / pyarrow support,  this project has the "==" token, and token =>  https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF | 
| That's a good point — @AugustoFKL are you comfortable given that  | 
| Pull Request Test Coverage Report for Build 4268364167
 
 💛 - Coveralls | 
| 
 Another think you might do (it is a bit of a hack) might be able to do is to modify the raw token stream directly to replace  So like following the model of Something like this (untested)         let mut tokenizer = Tokenizer::new(dialect, sql);
        let tokens = tokenizer.tokenize()?
           .into_iterator()
           .map(|tok| { 
             if tok == Token::DoubleEq {
               Token::Eq
             } else {
               tok
             })
        .collect();
        
        let parser = Parser::new(dialect).with_tokens(tokens)🤔 | 
| Marking as draft as this PR has gotten comments and I think is waiting for us to figure out what the right next steps are (it is not waiting for more reviews). | 
| 
 @alamb IIUC, this was meant to build the  | 
| 
 Yes, I think the intention was to build  I think the concern about parsing  | 
| It is fair. i will close it. | 
| @alamb tested the solution you suggested, Which does not work because it lacks the capability to parse to Token  | 
Support filters like