Skip to content

Commit

Permalink
fix: Put constraintName on the table, not column
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Aug 22, 2023
1 parent a4c8aa8 commit 3536732
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/src/main/java/io/cloudquery/helper/ArrowHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ public static Schema toArrowSchema(Table table) {
Map<String, String> metadata = new HashMap<>();
metadata.put("cq:extension:unique", column.isUnique() ? "true" : "false");
metadata.put("cq:extension:primary_key", column.isPrimaryKey() ? "true" : "false");
if (column.getConstraintName() != null) {
metadata.put("cq:extension:constraint_name", column.getConstraintName());
}
metadata.put("cq:extension:incremental", column.isIncrementalKey() ? "true" : "false");
Field field =
new Field(
Expand All @@ -171,6 +168,7 @@ public static Schema toArrowSchema(Table table) {
if (table.getParent() != null) {
metadata.put("cq:table_depends_on", table.getParent().getName());
}
metadata.put("cq:extension:constraint_name", table.getConstraintName());
return new Schema(asList(fields), metadata);
}

Expand Down
1 change: 0 additions & 1 deletion lib/src/main/java/io/cloudquery/schema/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
public class Column {
private String name;
private String description;
private String constraintName;
private ArrowType type;
private ColumnResolver resolver;
private boolean primaryKey;
Expand Down
1 change: 1 addition & 0 deletions lib/src/main/java/io/cloudquery/schema/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public static int maxDepth(List<Table> tables) {
}

@NonNull private String name;
@Builder.Default private String constraintName = "";
private TableResolver resolver;
private String title;
private String description;
Expand Down

0 comments on commit 3536732

Please sign in to comment.