diff --git a/web-console/src/utils/ingestion-spec.tsx b/web-console/src/utils/ingestion-spec.tsx index 9e506189478..678adbb9b78 100644 --- a/web-console/src/utils/ingestion-spec.tsx +++ b/web-console/src/utils/ingestion-spec.tsx @@ -255,11 +255,12 @@ const TIMESTAMP_SPEC_FORM_FIELDS: Field[] = [ { name: 'column', type: 'string', - isDefined: (timestampSpec: TimestampSpec) => isColumnTimestampSpec(timestampSpec) + defaultValue: 'timestamp' }, { name: 'format', type: 'string', + defaultValue: 'auto', suggestions: ['auto'].concat(TIMESTAMP_FORMAT_VALUES), isDefined: (timestampSpec: TimestampSpec) => isColumnTimestampSpec(timestampSpec), info:

@@ -269,12 +270,30 @@ const TIMESTAMP_SPEC_FORM_FIELDS: Field[] = [ { name: 'missingValue', type: 'string', - isDefined: (timestampSpec: TimestampSpec) => !isColumnTimestampSpec(timestampSpec) + placeholder: '(optional)', + info:

+ This value will be used if the specified column can not be found. +

} ]; -export function getTimestampSpecFormFields() { - return TIMESTAMP_SPEC_FORM_FIELDS; +const CONSTANT_TIMESTAMP_SPEC_FORM_FIELDS: Field[] = [ + { + name: 'missingValue', + label: 'Constant value', + type: 'string', + info:

+ The dummy value that will be used as the timestamp. +

+ } +]; + +export function getTimestampSpecFormFields(timestampSpec: TimestampSpec) { + if (isColumnTimestampSpec(timestampSpec)) { + return TIMESTAMP_SPEC_FORM_FIELDS; + } else { + return CONSTANT_TIMESTAMP_SPEC_FORM_FIELDS; + } } export function issueWithTimestampSpec(timestampSpec: TimestampSpec | undefined): string | null { diff --git a/web-console/src/views/load-data-view.tsx b/web-console/src/views/load-data-view.tsx index e69bf262f8a..dbaecd3ed1a 100644 --- a/web-console/src/views/load-data-view.tsx +++ b/web-console/src/views/load-data-view.tsx @@ -1112,7 +1112,7 @@ export class LoadDataView extends React.Component { this.updateSpec(deepSet(spec, 'dataSchema.parser.parseSpec.timestampSpec', timestampSpec));