diff --git a/src/main/java/net/sf/jsqlparser/statement/select/AllTableColumns.java b/src/main/java/net/sf/jsqlparser/statement/select/AllTableColumns.java index 0fbc4a080..6e131b07d 100644 --- a/src/main/java/net/sf/jsqlparser/statement/select/AllTableColumns.java +++ b/src/main/java/net/sf/jsqlparser/statement/select/AllTableColumns.java @@ -21,17 +21,23 @@ public class AllTableColumns extends AllColumns { private Table table; public AllTableColumns(Table table, ExpressionList exceptColumns, - List> replaceExpressions) { - super(exceptColumns, replaceExpressions); + List> replaceExpressions, String exceptKeyword) { + super(exceptColumns, replaceExpressions, exceptKeyword); this.table = table; } + public AllTableColumns(Table table, ExpressionList exceptColumns, + List> replaceExpressions) { + this(table, exceptColumns, replaceExpressions, "EXCEPT"); + } + public AllTableColumns(Table table) { this(table, null, null); } public AllTableColumns(Table table, AllColumns allColumns) { - this(table, allColumns.exceptColumns, allColumns.replaceExpressions); + this(table, allColumns.exceptColumns, allColumns.replaceExpressions, + allColumns.getExceptKeyword()); } public Table getTable() { diff --git a/src/test/java/net/sf/jsqlparser/statement/select/AllTableColumnsTest.java b/src/test/java/net/sf/jsqlparser/statement/select/AllTableColumnsTest.java index 0a0a9950c..f6dca8eba 100644 --- a/src/test/java/net/sf/jsqlparser/statement/select/AllTableColumnsTest.java +++ b/src/test/java/net/sf/jsqlparser/statement/select/AllTableColumnsTest.java @@ -22,4 +22,12 @@ void testBigQuerySyntax() throws JSQLParserException { + "FROM orders"; TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true); } + + @Test + void testDuckDBSyntax() throws JSQLParserException { + String sqlStr = + "SELECT orders.* EXCLUDE (order_id)\n" + + "FROM orders"; + TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true); + } }