-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from AdaptiveScale/release-2.1.2
Release 2.1.2
- Loading branch information
Showing
16 changed files
with
556 additions
and
10 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
40 changes: 40 additions & 0 deletions
40
common/src/main/java/com/adaptivescale/rosetta/common/models/ColumnProperties.java
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,40 @@ | ||
package com.adaptivescale.rosetta.common.models; | ||
|
||
public class ColumnProperties { | ||
|
||
private String name; | ||
|
||
private Integer sequenceId; | ||
|
||
public ColumnProperties() { | ||
} | ||
|
||
public ColumnProperties(String name, Integer sequenceId) { | ||
this.name = name; | ||
this.sequenceId = sequenceId; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Integer getSequenceId() { | ||
return sequenceId; | ||
} | ||
|
||
public void setSequenceId(Integer sequenceId) { | ||
this.sequenceId = sequenceId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ColumnProperties{" + | ||
"name='" + name + '\'' + | ||
", sequenceId=" + sequenceId + | ||
'}'; | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...ptivescale/rosetta/ddl/targets/kinetica/decorators/DefaultKineticaColumnSQLDecorator.java
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,32 @@ | ||
package com.adaptivescale.rosetta.ddl.targets.kinetica.decorators; | ||
|
||
import com.adaptivescale.rosetta.common.models.Column; | ||
import com.adaptivescale.rosetta.common.models.ColumnProperties; | ||
import com.adaptivescale.rosetta.ddl.targets.ColumnDataTypeName; | ||
import com.adaptivescale.rosetta.ddl.targets.ColumnSQLDecorator; | ||
|
||
import java.util.List; | ||
|
||
import static com.adaptivescale.rosetta.ddl.targets.postgres.Constants.DEFAULT_WRAPPER; | ||
|
||
public class DefaultKineticaColumnSQLDecorator implements ColumnSQLDecorator { | ||
private final Column column; | ||
private final ColumnDataTypeName columnDataTypeName; | ||
|
||
public DefaultKineticaColumnSQLDecorator(Column column, ColumnDataTypeName columnDataTypeName) { | ||
this.column = column; | ||
this.columnDataTypeName = columnDataTypeName; | ||
} | ||
|
||
@Override | ||
public String expressSQl() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append(DEFAULT_WRAPPER).append(column.getName()).append(DEFAULT_WRAPPER).append(" "); | ||
builder.append(columnDataTypeName.nameForColumn(column)); | ||
if(!column.isNullable()) { | ||
builder.append(" NOT NULL "); | ||
} | ||
return builder.toString(); | ||
} | ||
|
||
} |
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
141 changes: 141 additions & 0 deletions
141
ddl/src/test/resources/ddl/kinetica/add_column_with_column_properties/actual_model.yaml
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,141 @@ | ||
--- | ||
tables: | ||
- name: "PLAYER" | ||
type: "TABLE" | ||
schema: "ROSETTA" | ||
columns: | ||
- name: "name" | ||
typeName: "varchar" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 100 | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "POSITION_ID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
foreignKeys: | ||
- name: "PLAYER_FK" | ||
tableName: "PLAYER" | ||
columnName: "POSITION_ID" | ||
deleteRule: "3" | ||
primaryTableName: "Position" | ||
primaryColumnName: "ID" | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "ID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 1 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
nullable: false | ||
autoincrement: false | ||
primaryKey: true | ||
- name: "Position" | ||
type: "TABLE" | ||
schema: "ROSETTA" | ||
columns: | ||
- name: "ID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 1 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
nullable: false | ||
autoincrement: false | ||
primaryKey: true | ||
- name: "Name" | ||
typeName: "varchar" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 100 | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "TEAM" | ||
type: "TABLE" | ||
schema: "ROSETTA" | ||
columns: | ||
- name: "name" | ||
typeName: "varchar" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 100 | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "country" | ||
typeName: "varchar" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 100 | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "ID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 1 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
nullable: false | ||
autoincrement: false | ||
primaryKey: true | ||
- name: "TEAMPLAYERS" | ||
type: "TABLE" | ||
schema: "ROSETTA" | ||
columns: | ||
- name: "TEAMID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
foreignKeys: | ||
- name: "TEAMPLAYERS_FK_TEAM" | ||
tableName: "TEAMPLAYERS" | ||
columnName: "TEAMID" | ||
deleteRule: "3" | ||
primaryTableName: "TEAM" | ||
primaryColumnName: "ID" | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
- name: "PLAYERID" | ||
typeName: "numeric" | ||
ordinalPosition: 0 | ||
primaryKeySequenceId: 0 | ||
columnDisplaySize: 0 | ||
scale: 0 | ||
precision: 38 | ||
foreignKeys: | ||
- name: "TEAMPLAYERS_FK" | ||
tableName: "TEAMPLAYERS" | ||
columnName: "PLAYERID" | ||
deleteRule: "3" | ||
primaryTableName: "PLAYER" | ||
primaryColumnName: "ID" | ||
nullable: true | ||
autoincrement: false | ||
primaryKey: false | ||
databaseProductName: "kinetica" | ||
databaseType: "kinetica" |
Oops, something went wrong.