forked from JSQLParser/JSqlParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSQLParser#2119 add support INSERT OVERWRITE PARTITION
- Loading branch information
1 parent
23cd338
commit 20bfbc8
Showing
6 changed files
with
194 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/*- | ||
* #%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 StringBuilder appendPartitionsTo(StringBuilder builder, Collection<Partition> partitions) { | ||
int j = 0; | ||
for (Partition partition : partitions) { | ||
partition.appendTo(builder, j); | ||
j++; | ||
} | ||
return builder; | ||
} | ||
|
||
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"}) | ||
StringBuilder appendTo(StringBuilder builder, int j) { | ||
if (j > 0) { | ||
builder.append(", "); | ||
} | ||
builder.append(column.getColumnName()); | ||
if (value != null) { | ||
builder.append(" = ").append(value); | ||
} | ||
return builder; | ||
} | ||
} |
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