question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing is failing when fetching from table named `All`

See original GitHub issue

When trying to parse the query from table name all parsing fails. image

Full traceback:

Input In [24], in <cell line: 1>()
----> 1 mo_sql_parsing.parse('select count(*) from all')

File /usr/local/lib/python3.8/site-packages/mo_sql_parsing/__init__.py:37, in parse(sql, null, calls)
     35 if not common_parser:
     36     common_parser = sql_parser.common_parser()
---> 37 result = _parse(common_parser, sql, null, calls)
     38 return result

File /usr/local/lib/python3.8/site-packages/mo_sql_parsing/__init__.py:78, in _parse(parser, sql, null, calls)
     76 utils.scrub_op = calls
     77 sql = sql.rstrip().rstrip(";")
---> 78 parse_result = parser.parse_string(sql, parse_all=True)
     79 output = scrub(parse_result)
     80 for o, n in utils.null_locations:

File /usr/local/lib/python3.8/site-packages/mo_parsing/core.py:79, in entrypoint.<locals>.output(*args, **kwargs)
     76     except Exception as e:
     77         Log.error("reset action failed", cause=e)
---> 79 return func(*args, **kwargs)

File /usr/local/lib/python3.8/site-packages/mo_parsing/core.py:141, in Parser.parse(self, string, parse_all)
    116 @entrypoint
    117 def parse(self, string, parse_all=False):
    118     """
    119     Parse a string with respect to the parser definition. This function is intended as the primary interface to the
    120     client code.
   (...)
    139
    140     """
--> 141     return self._parseString(string, parse_all=parse_all)

File /usr/local/lib/python3.8/site-packages/mo_parsing/core.py:163, in Parser._parseString(self, string, parse_all)
    161         return tokens.tokens[0]
    162 except ParseException as cause:
--> 163     raise cause.best_cause from None

ParseException: Expecting (, found end of text (at char 24), (line:1, col:25)```

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
klahnakoskicommented, Jun 21, 2022

Thank you very much for pointing this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error with SQL query: The query failed to parse. Exception ...
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not ...
Read more >
failed to parse SQL query: ORA-01403 No Data Found
Hi, i ´ve a query that gives me that error when i´m working with a special user. 3 others users don´t get this...
Read more >
Error when trying to use output of Parse JSON
I used the payload to create the schema and the parse runs fine, rendering all the data into the proper variable names.
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
What went wrong? JSON. parse() parses a string as JSON. This string has to be valid JSON and will throw this error if...
Read more >
JR62512: HIVE CONNECTOR FAILS TO PARSE SELECT ...
sql.SQLSyntaxErrorException: [IBM][Hive JDBC Driver] [Hive]Error while compiling statement: FAILED: ParseException line 1:15 cannot recognize input near '< ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found