Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Custom Hive Column Relations] Fixing bug where relations linking to …
…hive columns was not working
  • Loading branch information
jajodia committed Mar 16, 2018
1 parent 92567f5 commit 2cf5e3e
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -21,6 +21,9 @@
import com.cloudera.nav.sdk.model.SourceType;
import com.cloudera.nav.sdk.model.annotations.MClass;
import com.cloudera.nav.sdk.model.annotations.MProperty;
import com.google.common.collect.ImmutableMap;

import java.util.Map;

/**
* Represents a Hive column; uniquely identified by the source id, database name,
Expand All @@ -30,6 +33,10 @@
@MClass(model="hv_column")
public class HiveColumn extends Entity {

private final String DATABASE_NAME = "databaseName";
private final String TABLE_NAME = "tableName";
private final String COLUMN_NAME = "columnName";

@MProperty
private String databaseName;
@MProperty
Expand Down Expand Up @@ -85,4 +92,12 @@ public String getColumnName() {
public void setColumnName(String columnName) {
this.columnName = columnName;
}

@Override
public Map<String, String> getIdAttrsMap() {
return ImmutableMap.of(
DATABASE_NAME, this.getDatabaseName(),
TABLE_NAME, this.getTableName(),
COLUMN_NAME, this.getColumnName());
}
}

0 comments on commit 2cf5e3e

Please sign in to comment.