mirror of https://github.com/apache/druid.git
Display null in SQL table cell (#7463)
* Display null if cell in table is empty * Add null * re-indent
This commit is contained in:
parent
c57e62bcd6
commit
233d485ad0
|
@ -36,6 +36,10 @@
|
||||||
|
|
||||||
.ReactTable {
|
.ReactTable {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
.null-table-cell {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,19 @@ export class SqlView extends React.Component<SqlViewProps, SqlViewState> {
|
||||||
loading={loading}
|
loading={loading}
|
||||||
noDataText={!loading && result && !result.rows.length ? 'No results' : (error || '')}
|
noDataText={!loading && result && !result.rows.length ? 'No results' : (error || '')}
|
||||||
sortable={false}
|
sortable={false}
|
||||||
columns={(result ? result.header : []).map((h: any, i) => ({ Header: h, accessor: String(i) }))}
|
columns={
|
||||||
|
(result ? result.header : []).map((h: any, i) => {
|
||||||
|
return {
|
||||||
|
Header: h,
|
||||||
|
accessor: String(i),
|
||||||
|
Cell: row => {
|
||||||
|
const value = row.value;
|
||||||
|
if (value === '' || value === null) return <span className="null-table-cell">null</span>;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}
|
||||||
defaultPageSize={10}
|
defaultPageSize={10}
|
||||||
className="-striped -highlight"
|
className="-striped -highlight"
|
||||||
/>;
|
/>;
|
||||||
|
|
Loading…
Reference in New Issue