Skip to content

Commit

Permalink
Record output column datatype in EventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveen2112 committed Jun 29, 2021
1 parent 2f92e3b commit 3abd8e3
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ private static QueryIOMetadata getQueryIOMetadata(QueryInfo queryInfo)
.map(columns -> columns.stream()
.map(column -> new OutputColumnMetadata(
column.getColumn().getName(),
column.getColumn().getType(),
column.getSourceColumns().stream()
.map(Analysis.SourceColumn::getColumnDetail)
.collect(toImmutableSet())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
public class OutputColumnMetadata
{
private final String columnName;
private final String columnType;
private final Set<ColumnDetail> sourceColumns;

@JsonCreator
public OutputColumnMetadata(String columnName, Set<ColumnDetail> sourceColumns)
public OutputColumnMetadata(String columnName, String columnType, Set<ColumnDetail> sourceColumns)
{
this.columnName = requireNonNull(columnName, "columnName is null");
this.columnType = requireNonNull(columnType, "columnType is null");
this.sourceColumns = requireNonNull(sourceColumns, "sourceColumns is null");
}

Expand All @@ -37,6 +39,11 @@ public String getColumnName()
return columnName;
}

public String getColumnType()
{
return columnType;
}

public Set<ColumnDetail> getSourceColumns()
{
return sourceColumns;
Expand All @@ -45,7 +52,7 @@ public Set<ColumnDetail> getSourceColumns()
@Override
public int hashCode()
{
return Objects.hash(columnName, sourceColumns);
return Objects.hash(columnName, columnType, sourceColumns);
}

@Override
Expand All @@ -59,6 +66,7 @@ public boolean equals(Object obj)
}
OutputColumnMetadata other = (OutputColumnMetadata) obj;
return Objects.equals(columnName, other.columnName) &&
Objects.equals(columnType, other.columnType) &&
Objects.equals(sourceColumns, other.sourceColumns);
}
}
Loading

0 comments on commit 3abd8e3

Please sign in to comment.