Skip to content

Commit e122bcf

Browse files
fix: De-parse TableFunction
Signed-off-by: Andreas Reichel <[email protected]> Signed-off-by: manticore-projects <[email protected]>
1 parent 469190d commit e122bcf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/java/net/sf/jsqlparser/util/deparser/ExpressionDeParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,11 @@ public <S> StringBuilder visit(Function function, S context) {
833833
} else if (function.isUnique()) {
834834
buffer.append("UNIQUE ");
835835
}
836+
837+
if (function.getExtraKeyword() != null) {
838+
buffer.append(function.getExtraKeyword()).append(" ");
839+
}
840+
836841
if (function.getNamedParameters() != null) {
837842
function.getNamedParameters().accept(this, context);
838843
}

src/main/java/net/sf/jsqlparser/util/deparser/SelectDeParser.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,14 @@ public <S> StringBuilder visit(TableStatement tableStatement, S context) {
704704

705705
@Override
706706
public <S> StringBuilder visit(TableFunction tableFunction, S context) {
707-
buffer.append(tableFunction.toString());
707+
if (tableFunction.getPrefix() != null) {
708+
buffer.append(tableFunction.getPrefix()).append(" ");
709+
}
710+
tableFunction.getFunction().accept(this.expressionVisitor, context);
711+
712+
if (tableFunction.getAlias() != null) {
713+
buffer.append(tableFunction.getAlias());
714+
}
708715
return buffer;
709716
}
710717

0 commit comments

Comments
 (0)