You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "clintropolis (via GitHub)" <gi...@apache.org> on 2023/05/01 19:33:46 UTC
[GitHub] [druid] clintropolis commented on a diff in pull request #14189: Web console: allow stringly schemas in the data loader
clintropolis commented on code in PR #14189:
URL: https://github.com/apache/druid/pull/14189#discussion_r1181827905
##########
web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx:
##########
@@ -2429,20 +2429,31 @@ export function updateSchemaWithSample(
let newSpec = spec;
- if (dimensionMode === 'auto-detect') {
- newSpec = deepSet(newSpec, 'spec.dataSchema.dimensionsSpec.useSchemaDiscovery', true);
- newSpec = deepSet(newSpec, 'spec.dataSchema.dimensionsSpec.includeAllDimensions', true);
- newSpec = deepSet(newSpec, 'spec.dataSchema.dimensionsSpec.dimensionExclusions', []);
- newSpec = deepDelete(newSpec, 'spec.dataSchema.dimensionsSpec.dimensions');
- } else {
- newSpec = deepDelete(newSpec, 'spec.dataSchema.dimensionsSpec.useSchemaDiscovery');
- newSpec = deepDelete(newSpec, 'spec.dataSchema.dimensionsSpec.includeAllDimensions');
- newSpec = deepDelete(newSpec, 'spec.dataSchema.dimensionsSpec.dimensionExclusions');
- newSpec = deepSet(
- newSpec,
- 'spec.dataSchema.dimensionsSpec.dimensions',
- getDimensionSpecs(sampleResponse, typeHints, guessNumericStringsAsNumbers, rollup),
- );
+ switch (schemaMode) {
+ case 'flexible':
+ newSpec = deepSet(newSpec, 'spec.dataSchema.dimensionsSpec.useSchemaDiscovery', true);
+ newSpec = deepSet(newSpec, 'spec.dataSchema.dimensionsSpec.includeAllDimensions', true);
Review Comment:
setting `useSchemaDiscovery` includes the functionality of `includeAllDimensions`, so it isn't necessary to set to support partial schema definition
--
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