You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by vo...@apache.org on 2020/08/12 02:22:59 UTC

[druid] branch master updated: Fix broken sampler for re-indexing (#10196)

This is an automated email from the ASF dual-hosted git repository.

vogievetsky pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 6baea0b  Fix broken sampler for re-indexing (#10196)
6baea0b is described below

commit 6baea0b4d510e81095c13ece59c8426d63216f8f
Author: Suneet Saldanha <su...@apache.org>
AuthorDate: Tue Aug 11 19:22:26 2020 -0700

    Fix broken sampler for re-indexing (#10196)
    
    * Fix broken sampler for re-indexer
    
    When re-indexing a Druid datasource, the web-console would generate an
    invalid inputFormat since the type is not specified.
    
    * code review
---
 web-console/src/utils/sampler.ts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/web-console/src/utils/sampler.ts b/web-console/src/utils/sampler.ts
index 8fed12e..c56f572 100644
--- a/web-console/src/utils/sampler.ts
+++ b/web-console/src/utils/sampler.ts
@@ -108,7 +108,9 @@ export function applyCache(sampleSpec: SampleSpec, cacheRows: CacheRows) {
   if (!cacheRows) return sampleSpec;
 
   // In order to prevent potential data loss null columns should be kept by the sampler and shown in the ingestion flow
-  sampleSpec = deepSet(sampleSpec, 'spec.ioConfig.inputFormat.keepNullColumns', true);
+  if (deepGet(sampleSpec, 'spec.ioConfig.inputFormat')) {
+    sampleSpec = deepSet(sampleSpec, 'spec.ioConfig.inputFormat.keepNullColumns', true);
+  }
 
   // If this is already an inline spec there is nothing to do
   if (deepGet(sampleSpec, 'spec.ioConfig.inputSource.type') === 'inline') return sampleSpec;
@@ -202,7 +204,9 @@ function makeSamplerIoConfig(
     ioConfig = deepSet(ioConfig, 'useEarliestSequenceNumber', sampleStrategy === 'start');
   }
   // In order to prevent potential data loss null columns should be kept by the sampler and shown in the ingestion flow
-  ioConfig = deepSet(ioConfig, 'inputFormat.keepNullColumns', true);
+  if (ioConfig.inputFormat) {
+    ioConfig = deepSet(ioConfig, 'inputFormat.keepNullColumns', true);
+  }
   return ioConfig;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org