Conversation
Allow Complex Expressions as SelectItem
| { | ||
| expression=Condition() { selectExpressionItem = new SelectExpressionItem(); selectExpressionItem.setExpression(expression); } | ||
| [alias=Alias() { selectExpressionItem.setAlias(alias); }] { return selectExpressionItem; } | ||
| expression=Expression() { selectExpressionItem = new SelectExpressionItem(); selectExpressionItem.setExpression(expression); } |
There was a problem hiding this comment.
How does this impact the performance of JSqlParser? It is a drastic change in the complexety the parser has to deal with.
There was a problem hiding this comment.
It certainly runs a bit slower e. g. the full test suite takes now around 26 seconds instead of 22 seconds before.
However, this is a very unscientific way to measure and most importantly: everything runs through and is correct. Also I am still able to use the near time parsing in the Online JSQLFormatter Instance (highlighting errors while I type.)
In my book, while we strive for performance, correctness always beats execution speed.
If you want to write the fastest possible (but incorrect) parser, then this would also be the smallest possible grammar: just throw an exception on everything :-D
There was a problem hiding this comment.
Strange argument, since this parser will never be in that sense correct. However, resolve conflicts and I will merge.
# Conflicts: # src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java
# Conflicts: # src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java
Allow Complex Expressions as SelectItem
Fixes #1381
Fixes #602