You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "wugeer (via GitHub)" <gi...@apache.org> on 2024/10/12 07:30:24 UTC

[I] hive doesn't support `!` as a synonym for `not` [datafusion-sqlparser-rs]

wugeer opened a new issue, #1471:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1471

   Hive supports `!` as a synonym for `not`, but the current project's Hive dialect supports the `select !a` syntax.
   
   https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362046#LanguageManualUDF-LogicalOperators
   
   ![image](https://github.com/user-attachments/assets/61b39751-d0ee-4a9c-96a8-3d9f9d1a4d7c)
   
   The reproduction steps are as follows:
   
   ```bash
   echo "select not (false), !a" > ok.sql
   cargo run --features json_example --example cli ok.sql  --hive
       Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
        Running `target/debug/examples/cli ok.sql --hive`
   Parsing from file 'ok.sql' using HiveDialect
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] Parsing sql 'select not (false), !a
   '...
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] parsing expr
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] parsing expr
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] parsing expr
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] prefix: Value(Boolean(false))
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::dialect] get_next_precedence_full() TokenWithLocation { token: RParen, location: Location { line: 1, column: 18 } }
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] next precedence: 0
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] prefix: Nested(Value(Boolean(false)))
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::dialect] get_next_precedence_full() TokenWithLocation { token: Comma, location: Location { line: 1, column: 19 } }
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] next precedence: 0
   2024-10-12T07:25:23.412Z DEBUG [sqlparser::parser] prefix: UnaryOp { op: Not, expr: Nested(Value(Boolean(false))) }
   2024-10-12T07:25:23.413Z DEBUG [sqlparser::dialect] get_next_precedence_full() TokenWithLocation { token: Comma, location: Location { line: 1, column: 19 } }
   2024-10-12T07:25:23.413Z DEBUG [sqlparser::parser] next precedence: 0
   2024-10-12T07:25:23.413Z DEBUG [sqlparser::parser] parsing expr
   Error during parsing: ParserError("Expected: an expression, found: ! at Line: 1, Column: 21")
   ```


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] hive doesn't support `!a` expression [datafusion-sqlparser-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #1471: hive doesn't support `!a` expression
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1471


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org