Commit e817b214 by Keval Bhatt

ATLAS-772 Ordering of columns is not maintained in schema query response, where…

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)
parent a2c3faad
...@@ -576,7 +576,7 @@ public class HiveMetaStoreBridge { ...@@ -576,7 +576,7 @@ public class HiveMetaStoreBridge {
public List<Referenceable> getColumns(List<FieldSchema> schemaList, Referenceable tableReference) throws Exception { public List<Referenceable> getColumns(List<FieldSchema> schemaList, Referenceable tableReference) throws Exception {
List<Referenceable> colList = new ArrayList<>(); List<Referenceable> colList = new ArrayList<>();
int columnPosition = 0;
for (FieldSchema fs : schemaList) { for (FieldSchema fs : schemaList) {
LOG.debug("Processing field " + fs); LOG.debug("Processing field " + fs);
Referenceable colReferenceable = new Referenceable(HiveDataTypes.HIVE_COLUMN.getName()); Referenceable colReferenceable = new Referenceable(HiveDataTypes.HIVE_COLUMN.getName());
...@@ -585,9 +585,11 @@ public class HiveMetaStoreBridge { ...@@ -585,9 +585,11 @@ public class HiveMetaStoreBridge {
colReferenceable.set(AtlasClient.NAME, fs.getName()); colReferenceable.set(AtlasClient.NAME, fs.getName());
colReferenceable.set(AtlasClient.OWNER, tableReference.get(AtlasClient.OWNER)); colReferenceable.set(AtlasClient.OWNER, tableReference.get(AtlasClient.OWNER));
colReferenceable.set("type", fs.getType()); colReferenceable.set("type", fs.getType());
colReferenceable.set(HiveDataModelGenerator.POSITION, columnPosition++);
colReferenceable.set(HiveDataModelGenerator.COMMENT, fs.getComment()); colReferenceable.set(HiveDataModelGenerator.COMMENT, fs.getComment());
colReferenceable.set(HiveDataModelGenerator.TABLE, tableReference.getId()); colReferenceable.set(HiveDataModelGenerator.TABLE, tableReference.getId());
colList.add(colReferenceable); colList.add(colReferenceable);
} }
return colList; return colList;
......
...@@ -64,6 +64,7 @@ public class HiveDataModelGenerator { ...@@ -64,6 +64,7 @@ public class HiveDataModelGenerator {
public static final String COMMENT = "comment"; public static final String COMMENT = "comment";
public static final String PARAMETERS = "parameters"; public static final String PARAMETERS = "parameters";
public static final String COLUMNS = "columns"; public static final String COLUMNS = "columns";
public static final String POSITION = "position";
public static final String PART_COLS = "partitionKeys"; public static final String PART_COLS = "partitionKeys";
public static final String TABLE_ALIAS_LIST = "aliases"; public static final String TABLE_ALIAS_LIST = "aliases";
...@@ -224,7 +225,8 @@ public class HiveDataModelGenerator { ...@@ -224,7 +225,8 @@ public class HiveDataModelGenerator {
new AttributeDefinition(COMMENT, DataTypes.STRING_TYPE.getName(), Multiplicity.OPTIONAL, false, null), new AttributeDefinition(COMMENT, DataTypes.STRING_TYPE.getName(), Multiplicity.OPTIONAL, false, null),
//Making this optional since this is an incompatible change //Making this optional since this is an incompatible change
//Reverse attribute to 'columns' in Table //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 = HierarchicalTypeDefinition<ClassType> definition =
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_COLUMN.getName(), null, new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_COLUMN.getName(), null,
......
...@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ...@@ -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) ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES: 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-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-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) ATLAS-1129 Remove notification failed logs on retry and add sleep between retries (svimal2106 via sumasai)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment