-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
SQL parsing is successful, but failed to retrieve the table name.
TablesNamesFinder<Void> tablesNamesFinder = new TablesNamesFinder<>();
Set<String> tables = tablesNamesFinder.getTables(statement);
ERROR:
Exception in thread "main" java.lang.NullPointerException
at net.sf.jsqlparser.util.TablesNamesFinder.visit(TablesNamesFinder.java:799)
at net.sf.jsqlparser.expression.AnalyticExpression.accept(AnalyticExpression.java:91)
at net.sf.jsqlparser.util.TablesNamesFinder.visit(TablesNamesFinder.java:946)
at net.sf.jsqlparser.statement.select.SelectItem.accept(SelectItem.java:91)
at net.sf.jsqlparser.util.TablesNamesFinder.visit(TablesNamesFinder.java:355)
at net.sf.jsqlparser.statement.select.PlainSelect.accept(PlainSelect.java:319)
at net.sf.jsqlparser.util.TablesNamesFinder.visit(TablesNamesFinder.java:266)
at net.sf.jsqlparser.statement.select.Select.accept(Select.java:434)
at net.sf.jsqlparser.util.TablesNamesFinder.getTables(TablesNamesFinder.java:239)
at com.style.tools.util.JSQLParseUtil.main(JSQLParseUtil.java:45)
SQL Example:
SELECT
subscriber_id,
sum(1) OVER (PARTITION BY subscriber_id
ORDER BY
stat_time ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS stop_id
FROM
(
SELECT
subscriber_id,
stat_time
FROM
location_subscriber AS mid2 WINDOW w AS (PARTITION BY subscriber_id
ORDER BY
stat_time ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING ) )
Software Information:
- JSqlParser version 5.1
Metadata
Metadata
Assignees
Labels
No labels