Add delimiter option for TSV parser (#8741)

This commit is contained in:
Vadim Ogievetsky 2019-10-25 09:17:59 -07:00 committed by Fangjin Yang
parent b9d10473a5
commit 27127345b7
2 changed files with 12 additions and 2 deletions

View File

@ -329,11 +329,18 @@ const PARSE_SPEC_FORM_FIELDS: Field<ParseSpec>[] = [
defined: (p: ParseSpec) =>
((p.format === 'csv' || p.format === 'tsv') && !p.hasHeaderRow) || p.format === 'regex',
},
{
name: 'delimiter',
type: 'string',
defaultValue: '\t',
defined: (p: ParseSpec) => p.format === 'tsv',
info: <>A custom delimiter for data values.</>,
},
{
name: 'listDelimiter',
type: 'string',
defaultValue: '|',
defined: (p: ParseSpec) => p.format === 'csv' || p.format === 'tsv',
info: <>A custom delimiter for multi-value dimensions.</>,
},
];

View File

@ -524,7 +524,10 @@ export class SegmentsView extends React.PureComponent<SegmentsViewProps, Segment
accessor: 'size',
filterable: false,
defaultSortDesc: true,
Cell: row => formatBytes(row.value),
Cell: row => {
if (row.value === 0 && row.original.is_realtime === 1) return '(realtime)';
return formatBytes(row.value);
},
show: hiddenColumns.exists('Size'),
},
{