You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2016/09/01 07:12:04 UTC
[1/2] incubator-atlas git commit: ATLAS-772 Ordering of columns is
not maintained in schema query response,
where as hive table entity response maintains the ordering
(sarath.kum4r@gmail.com via kevalbhatt)
Repository: incubator-atlas
Updated Branches:
refs/heads/master a2c3faad1 -> f54325f1c
ATLAS-772 Ordering of columns is not maintained in schema query response, where as hive table entity response maintains the ordering (sarath.kum4r@gmail.com via kevalbhatt)
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e817b214
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e817b214
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e817b214
Branch: refs/heads/master
Commit: e817b214387525def94930a7375b297157037155
Parents: a2c3faa
Author: Keval Bhatt <kb...@apache.org>
Authored: Thu Sep 1 12:36:30 2016 +0530
Committer: Keval Bhatt <kb...@apache.org>
Committed: Thu Sep 1 12:36:30 2016 +0530
----------------------------------------------------------------------
.../java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java | 4 +++-
.../java/org/apache/atlas/hive/model/HiveDataModelGenerator.java | 4 +++-
release-log.txt | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e817b214/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
index 1f13d74..ad7a4a5 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
@@ -576,7 +576,7 @@ public class HiveMetaStoreBridge {
public List<Referenceable> getColumns(List<FieldSchema> schemaList, Referenceable tableReference) throws Exception {
List<Referenceable> colList = new ArrayList<>();
-
+ int columnPosition = 0;
for (FieldSchema fs : schemaList) {
LOG.debug("Processing field " + fs);
Referenceable colReferenceable = new Referenceable(HiveDataTypes.HIVE_COLUMN.getName());
@@ -585,9 +585,11 @@ public class HiveMetaStoreBridge {
colReferenceable.set(AtlasClient.NAME, fs.getName());
colReferenceable.set(AtlasClient.OWNER, tableReference.get(AtlasClient.OWNER));
colReferenceable.set("type", fs.getType());
+ colReferenceable.set(HiveDataModelGenerator.POSITION, columnPosition++);
colReferenceable.set(HiveDataModelGenerator.COMMENT, fs.getComment());
colReferenceable.set(HiveDataModelGenerator.TABLE, tableReference.getId());
+
colList.add(colReferenceable);
}
return colList;
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e817b214/addons/hive-bridge/src/main/java/org/apache/atlas/hive/model/HiveDataModelGenerator.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/model/HiveDataModelGenerator.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/model/HiveDataModelGenerator.java
index b308cc9..45f0bc9 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/model/HiveDataModelGenerator.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/model/HiveDataModelGenerator.java
@@ -64,6 +64,7 @@ public class HiveDataModelGenerator {
public static final String COMMENT = "comment";
public static final String PARAMETERS = "parameters";
public static final String COLUMNS = "columns";
+ public static final String POSITION = "position";
public static final String PART_COLS = "partitionKeys";
public static final String TABLE_ALIAS_LIST = "aliases";
@@ -224,7 +225,8 @@ public class HiveDataModelGenerator {
new AttributeDefinition(COMMENT, DataTypes.STRING_TYPE.getName(), Multiplicity.OPTIONAL, false, null),
//Making this optional since this is an incompatible change
//Reverse attribute to 'columns' in Table
- new AttributeDefinition(TABLE, HiveDataTypes.HIVE_TABLE.getName(), Multiplicity.OPTIONAL, false, COLUMNS),};
+ new AttributeDefinition(TABLE, HiveDataTypes.HIVE_TABLE.getName(), Multiplicity.OPTIONAL, false, COLUMNS),
+ new AttributeDefinition(POSITION, DataTypes.INT_TYPE.getName(), Multiplicity.OPTIONAL, false, false, false, null)};
HierarchicalTypeDefinition<ClassType> definition =
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_COLUMN.getName(), null,
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e817b214/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 137acba..1a1e0ca 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
+ATLAS-772 Ordering of columns is not maintained in schema query response, where as hive table entity response maintains the ordering (sarath.kum4r@gmail.com via kevalbhatt)
ATLAS-1140 All the tag's attributes are not seen while applying a tag to entity (kevalbhatt)
ATLAS-1141 UI-Issue - Tag with spaces, when searched, then it is wrongly set in search textbox. (Kalyanikashikar via kevalbhatt)
ATLAS-1129 Remove notification failed logs on retry and add sleep between retries (svimal2106 via sumasai)
[2/2] incubator-atlas git commit: ATLAS-1147 UI: column name doesn't
show up in schema tab for hive table (Kalyanikashikar via kevalbhatt)
Posted by kb...@apache.org.
ATLAS-1147 UI: column name doesn't show up in schema tab for hive table (Kalyanikashikar via kevalbhatt)
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/f54325f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/f54325f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/f54325f1
Branch: refs/heads/master
Commit: f54325f1c99fec1a9d06a1fab7893b7656a8398f
Parents: e817b21
Author: Keval Bhatt <kb...@apache.org>
Authored: Thu Sep 1 12:41:22 2016 +0530
Committer: Keval Bhatt <kb...@apache.org>
Committed: Thu Sep 1 12:41:22 2016 +0530
----------------------------------------------------------------------
.../public/js/views/schema/SchemaLayoutView.js | 192 ++++++++++++-------
release-log.txt | 1 +
2 files changed, 126 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f54325f1/dashboardv2/public/js/views/schema/SchemaLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
index 9bd8c82..dc19619 100644
--- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js
+++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
@@ -98,6 +98,7 @@ define(['require',
includePagination: true,
includePageSize: false,
includeFooterRecords: true,
+ includeOrderAbleColumns: true,
gridOpts: {
className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!'
@@ -177,12 +178,29 @@ define(['require',
sortKey: "position",
comparator: function(item) {
return item.get(this.sortKey) || 999;
+ },
+ setPositions: function() {
+ _.each(this.models, function(model, index) {
+ if (model.get('name') == "name") {
+ model.set("position", 2, { silent: true });
+ model.set("label", "Name");
+ } else if (model.get('name') == "description") {
+ model.set("position", 3, { silent: true });
+ model.set("label", "Description");
+ } else if (model.get('name') == "owner") {
+ model.set("position", 4, { silent: true });
+ model.set("label", "Owner");
+ }
+ });
+ return this;
}
});
var columns = new columnCollection(that.getSchemaTableColumns());
+ columns.setPositions().sort();
that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent,
- columns: columns
+ columns: columns,
+ includeOrderAbleColumns: true
})));
that.$('.multiSelectTerm').hide();
that.$('.multiSelectTag').hide();
@@ -199,86 +217,126 @@ define(['require',
});
},
getSchemaTableColumns: function() {
- var that = this;
- var col = {};
- if (this.schemaCollection.keyList) {
- _.each(this.schemaCollection.keyList, function(obj, key) {
- col[obj.name] = {
- cell: "Html",
- editable: false,
- sortable: false,
- orderable: true,
- formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
- fromRaw: function(rawValue, model) {
- if (model) {
- if (!_.isArray(rawValue) && _.isObject(rawValue)) {
- if (rawValue.id) {
- return '<div><a href="#!/detailPage/' + rawValue.id + '">' + rawValue.$typeName$ + '</a></div>';
- } else {
- return rawValue.$typeName$;
- }
- } else if (_.isArray(rawValue)) {
- var links = "";
- _.each(rawValue, function(val, key) {
- if (val.id) {
- links += '<div><a href="#!/detailPage/' + val.id + '">' + val.$typeName$ + '</a></div>';
+ var that = this,
+ col = {},
+ nameCheck = false,
+ modelJSON = this.schemaCollection.toJSON()[0];
+ for (var i = 0; i < this.schemaCollection.models.length; i++) {
+ var model = this.schemaCollection.models[i];
+ if (model && (model.get('name') || model.get('qualifiedName'))) {
+ nameCheck = true;
+ }
+ }
+ if (nameCheck === true) {
+ col['name'] = {
+ label: "Name",
+ cell: "html",
+ editable: false,
+ sortable: false,
+ className: "searchTableName",
+ formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+ fromRaw: function(rawValue, model) {
+ var nameHtml = "";
+ if (rawValue === undefined) {
+ if (model.get('qualifiedName')) {
+ rawValue = model.get('qualifiedName');
+ } else if (model.get('$id$') && model.get('$id$').qualifiedName) {
+ rawValue = model.get('$id$').qualifiedName;
+ } else {
+ return "";
+ }
+ }
+ if (model.get('$id$') && model.get('$id$').id) {
+ nameHtml = '<a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a>';
+ } else {
+ nameHtml = '<a>' + rawValue + '</a>';
+ }
+ if (model.get('$id$') && model.get('$id$').state && Globals.entityStateReadOnly[model.get('$id$').state]) {
+ nameHtml += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+ return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
+ } else {
+ return nameHtml;
+ }
+ }
+ })
+ };
+ };
+ _.keys(modelJSON).map(function(key) {
+ if (key.indexOf("$") == -1) {
+ if (!(key === "qualifiedName" || key === "name")) {
+ col[key] = {
+ cell: "Html",
+ editable: false,
+ sortable: false,
+ orderable: true,
+ formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+ fromRaw: function(rawValue, model) {
+ if (model) {
+ if (!_.isArray(rawValue) && _.isObject(rawValue)) {
+ if (rawValue.id) {
+ return '<div><a href="#!/detailPage/' + rawValue.id + '">' + rawValue.$typeName$ + '</a></div>';
} else {
- links += '<div>' + val.$typeName$ + '</div>';
+ return rawValue.$typeName$;
}
- });
- return links;
-
- } else if (model.get('$id$') && model.get('$id$').id && model.get('name') == rawValue) {
- return '<div><a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a></div>';
+ } else if (_.isArray(rawValue)) {
+ var links = "";
+ _.each(rawValue, function(val, key) {
+ if (val.id) {
+ links += '<div><a href="#!/detailPage/' + val.id + '">' + val.$typeName$ + '</a></div>';
+ } else {
+ links += '<div>' + val.$typeName$ + '</div>';
+ }
+ });
+ return links;
+ } else {
+ return rawValue;
+ }
} else {
return rawValue;
}
- } else {
- return rawValue;
}
-
- }
- })
- };
- });
- col['Check'] = {
- name: "selected",
- label: "",
- cell: "select-row",
- headerCell: "select-all",
- position: 1
- };
- col['tag'] = {
- label: "Tags",
+ })
+ };
+ }
+ }
+ });
+ col['Check'] = {
+ name: "selected",
+ label: "",
+ cell: "select-row",
+ headerCell: "select-all",
+ position: 1
+ };
+ col['tag'] = {
+ label: "Tags",
+ cell: "Html",
+ editable: false,
+ sortable: false,
+ className: 'searchTag',
+ formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+ fromRaw: function(rawValue, model) {
+ return CommonViewFunction.tagForTable(model);
+ }
+ })
+ };
+ if (Globals.taxonomy) {
+ col['terms'] = {
+ label: "Terms",
cell: "Html",
editable: false,
sortable: false,
- className: 'searchTag',
+ orderable: true,
+ className: 'searchTerm',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- return CommonViewFunction.tagForTable(model);
+ var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema");
+ if (returnObject.object) {
+ that.bradCrumbList.push(returnObject.object);
+ }
+ return returnObject.html;
}
})
};
- if (Globals.taxonomy) {
- col['terms'] = {
- label: "Terms",
- cell: "Html",
- editable: false,
- sortable: false,
- orderable: true,
- className: 'searchTerm',
- formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
- fromRaw: function(rawValue, model) {
- var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema");
- if (returnObject.object) {
- that.bradCrumbList.push(returnObject.object);
- }
- return returnObject.html;
- }
- })
- };
- }
}
return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection);
},
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f54325f1/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 1a1e0ca..e4b6fe1 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
+ATLAS-1147 UI: column name doesn't show up in schema tab for hive table (Kalyanikashikar via kevalbhatt)
ATLAS-772 Ordering of columns is not maintained in schema query response, where as hive table entity response maintains the ordering (sarath.kum4r@gmail.com via kevalbhatt)
ATLAS-1140 All the tag's attributes are not seen while applying a tag to entity (kevalbhatt)
ATLAS-1141 UI-Issue - Tag with spaces, when searched, then it is wrongly set in search textbox. (Kalyanikashikar via kevalbhatt)