Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[chore] One more test, code cleanup
  • Loading branch information
ANeumann82 committed Apr 2, 2026
commit c65de4488f8531ddb8c791f60d5a31b7c3e31c4b
27 changes: 12 additions & 15 deletions src/main/java/net/sf/jsqlparser/expression/JsonTableFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
import net.sf.jsqlparser.statement.create.table.ColDataType;

public class JsonTableFunction extends Function {

private Expression jsonInputExpression;
private Expression jsonPathExpression;
private String pathName;
private final List<JsonTablePassingClause> passingClauses = new ArrayList<>();
private JsonTableColumnsClause columnsClause;
private JsonTablePlanClause planClause;
private JsonTableOnErrorClause onErrorClause;
private JsonTableParsingTypeClause parsingTypeClause;
private JsonTableOnEmptyClause onEmptyClause;
private boolean formatJson;

public enum JsonTablePlanOperator {
COMMA(", "), INNER(" INNER "), OUTER(" OUTER "), CROSS(" CROSS "), UNION(" UNION ");

Expand Down Expand Up @@ -215,8 +227,6 @@ public String toString() {
public static class JsonTableOnEmptyClause extends ASTNodeAccessImpl implements Serializable {
private JsonTableOnEmptyType type;

public JsonTableOnEmptyClause() {}

public JsonTableOnEmptyType getType() {
return type;
}
Expand All @@ -236,8 +246,6 @@ public static class JsonTableParsingTypeClause extends ASTNodeAccessImpl
implements Serializable {
private JsonTableParsingType type;

public JsonTableParsingTypeClause() {}

public JsonTableParsingType getType() {
return type;
}
Expand Down Expand Up @@ -691,17 +699,6 @@ public String toString() {
}
}

private Expression jsonInputExpression;
private Expression jsonPathExpression;
private String pathName;
private final List<JsonTablePassingClause> passingClauses = new ArrayList<>();
private JsonTableColumnsClause columnsClause;
private JsonTablePlanClause planClause;
private JsonTableOnErrorClause onErrorClause;
private JsonTableParsingTypeClause parsingTypeClause;
private JsonTableOnEmptyClause onEmptyClause;
private boolean formatJson;

public JsonTableFunction() {
setName("JSON_TABLE");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ void testExistsColumns(String jsonTableStr) throws JSQLParserException {
"JSON_TABLE(document COLUMNS( val FORMAT JSON PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val ALLOW SCALARS PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val DISALLOW SCALARS PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val VARCHAR(240) ALLOW SCALARS PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val INT DISALLOW SCALARS PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val FORMAT JSON DISALLOW SCALARS PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val WITH WRAPPER PATH '$.pathTest'))",
"JSON_TABLE(document COLUMNS( val WITHOUT WRAPPER PATH '$.pathTest'))",
Expand Down
Loading