Skip to content
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

hive doesn't support !a expression #1471

Open
wugeer opened this issue Oct 12, 2024 · 0 comments · May be fixed by #1472
Open

hive doesn't support !a expression #1471

wugeer opened this issue Oct 12, 2024 · 0 comments · May be fixed by #1472

Comments

@wugeer
Copy link

wugeer commented Oct 12, 2024

Hive supports ! as a synonym for not, but the current project's Hive dialect does not support the select !a syntax.

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362046#LanguageManualUDF-LogicalOperators

image

The reproduction steps are as follows:

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")
@wugeer wugeer changed the title hive doesn't support ! as a synonym for not hive doesn't support !a expression Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant