Skip to content

Commit

Permalink
fix: AllTableColumns, DuckDB specific EXCLUDE
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Reichel <[email protected]>
  • Loading branch information
manticore-projects committed Jun 10, 2024
1 parent 2ace74d commit c9ecfc6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ public class AllTableColumns extends AllColumns {
private Table table;

public AllTableColumns(Table table, ExpressionList<Column> exceptColumns,
List<SelectItem<Column>> replaceExpressions) {
super(exceptColumns, replaceExpressions);
List<SelectItem<Column>> replaceExpressions, String exceptKeyword) {
super(exceptColumns, replaceExpressions, exceptKeyword);
this.table = table;
}

public AllTableColumns(Table table, ExpressionList<Column> exceptColumns,
List<SelectItem<Column>> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit c9ecfc6

Please sign in to comment.