You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "abhishekrb19 (via GitHub)" <gi...@apache.org> on 2023/05/02 23:49:25 UTC
[GitHub] [druid] abhishekrb19 commented on a diff in pull request #14189: Web console: allow stringly schemas in the data loader
abhishekrb19 commented on code in PR #14189:
URL: https://github.com/apache/druid/pull/14189#discussion_r1183131759
##########
web-console/src/views/load-data-view/load-data-view.tsx:
##########
@@ -2622,32 +2625,57 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
}
renderChangeDimensionModeAction() {
- const { newDimensionMode, spec, cacheRows } = this.state;
- if (typeof newDimensionMode === 'undefined' || !cacheRows) return;
- const autoDetect = newDimensionMode === 'auto-detect';
+ const { newSchemaMode, spec, cacheRows } = this.state;
+ if (!newSchemaMode || !cacheRows) return;
+ const autoDetect = newSchemaMode !== 'fixed';
return (
<AsyncActionDialog
action={async () => {
const sampleResponse = await sampleForTransform(spec, cacheRows);
this.updateSpec(
- updateSchemaWithSample(spec, sampleResponse, newDimensionMode, getRollup(spec)),
+ updateSchemaWithSample(spec, sampleResponse, newSchemaMode, getRollup(spec)),
);
}}
- confirmButtonText={`Yes - ${autoDetect ? 'auto detect' : 'explicitly set'} columns`}
+ confirmButtonText={`Yes - ${autoDetect ? 'auto detect' : 'explicitly define'} schema`}
successText={`Dimension mode changes to ${
autoDetect ? 'auto detect' : 'specific list'
}. Schema has been updated.`}
- failText="Could change dimension mode"
+ failText="Could not change schema mode"
intent={Intent.WARNING}
- onClose={() => this.setState({ newDimensionMode: undefined })}
+ onClose={() => this.setState({ newSchemaMode: undefined })}
>
<p>
{autoDetect
- ? `Are you sure you don't want to explicitly specify a dimension list?`
- : `Are you sure you want to explicitly specify a dimension list?`}
+ ? `Are you sure you want Druid to auto detect the data schema?`
+ : `Are you sure you want to explicitly specify a schema?`}
</p>
<p>Making this change will reset any work you have done in this section.</p>
+ {autoDetect && (
+ <Switch
+ checked={newSchemaMode === 'type-aware-discovery'}
+ onChange={() => {
+ this.setState({
+ newSchemaMode:
+ newSchemaMode === 'string-only-discovery'
+ ? 'type-aware-discovery'
+ : 'string-only-discovery',
+ });
+ }}
+ >
+ Use the new type-aware schema discovery capability. Avoid this if are appending to a
Review Comment:
```suggestion
Use the new type-aware schema discovery capability. Avoid this if you are appending to a
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org