-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #2119 add support INSERT OVERWRITE PARTITION * #2119 fix test case * #2119 add reserved keyword * run spotlessApply
- Loading branch information
1 parent
d624175
commit f1dee4c
Showing
7 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/*- | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2025 JSQLParser | ||
* %% | ||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.schema; | ||
|
||
import net.sf.jsqlparser.expression.Expression; | ||
|
||
import java.util.Collection; | ||
import java.util.Objects; | ||
|
||
public class Partition { | ||
protected Column column; | ||
protected Expression value; | ||
|
||
public Partition() { | ||
|
||
} | ||
|
||
public Partition(Column column, Expression value) { | ||
this.column = column; | ||
this.value = value; | ||
} | ||
|
||
public static void appendPartitionsTo(StringBuilder builder, | ||
Collection<Partition> partitions) { | ||
int j = 0; | ||
for (Partition partition : partitions) { | ||
partition.appendTo(builder, j); | ||
j++; | ||
} | ||
} | ||
|
||
public Column getColumn() { | ||
return column; | ||
} | ||
|
||
public void setColumn(Column column) { | ||
this.column = Objects.requireNonNull(column); | ||
} | ||
|
||
public Expression getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(Expression value) { | ||
this.value = Objects.requireNonNull(value); | ||
} | ||
|
||
|
||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPath"}) | ||
void appendTo(StringBuilder builder, int j) { | ||
if (j > 0) { | ||
builder.append(", "); | ||
} | ||
builder.append(column.getColumnName()); | ||
if (value != null) { | ||
builder.append(" = ").append(value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters