@@ -112,7 +112,8 @@ const DefaultWildcardIndexName = "*"
112112
113113// Configuration of QuesmaV1ProcessorQuery and QuesmaV1ProcessorIngest
114114type QuesmaProcessorConfig struct {
115- IndexConfig map [string ]IndexConfiguration `koanf:"indexes"`
115+ UseCommonTable bool `koanf:"useCommonTable"`
116+ IndexConfig map [string ]IndexConfiguration `koanf:"indexes"`
116117}
117118
118119func LoadV2Config () QuesmaNewConfiguration {
@@ -296,6 +297,9 @@ func (c *QuesmaNewConfiguration) validatePipelines() error {
296297 queryProcessor .Type != QuesmaV1ProcessorNoOp {
297298 return fmt .Errorf ("query pipeline must have query or noop processor" )
298299 }
300+ if queryProcessor .Config .UseCommonTable != ingestProcessor .Config .UseCommonTable {
301+ return fmt .Errorf ("query and ingest processors must have the same configuration of 'useCommonTable'" )
302+ }
299303 if ! (queryProcessor .Type == QuesmaV1ProcessorNoOp ) {
300304 if _ , found := queryProcessor .Config .IndexConfig [DefaultWildcardIndexName ]; ! found {
301305 return fmt .Errorf ("the default index configuration (under the name '%s') must be defined in the query processor" , DefaultWildcardIndexName )
@@ -565,6 +569,10 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
565569 if val , exists := target .properties ["useCommonTable" ]; exists {
566570 conf .CreateCommonTable = val == "true"
567571 conf .UseCommonTableForWildcard = val == "true"
572+ } else {
573+ // inherit setting from the processor level
574+ conf .CreateCommonTable = queryProcessor .Config .UseCommonTable
575+ conf .UseCommonTableForWildcard = queryProcessor .Config .UseCommonTable
568576 }
569577 }
570578
@@ -600,6 +608,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
600608 }
601609 if val , exists := target .properties ["useCommonTable" ]; exists {
602610 processedConfig .UseCommonTable = val == "true"
611+ } else {
612+ // inherit setting from the processor level
613+ processedConfig .UseCommonTable = queryProcessor .Config .UseCommonTable
603614 }
604615 if val , exists := target .properties ["tableName" ]; exists {
605616 processedConfig .Override = val .(string )
@@ -660,6 +671,10 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
660671 if val , exists := target .properties ["useCommonTable" ]; exists {
661672 conf .CreateCommonTable = val == "true"
662673 conf .UseCommonTableForWildcard = val == "true"
674+ } else {
675+ // inherit setting from the processor level
676+ conf .CreateCommonTable = queryProcessor .Config .UseCommonTable
677+ conf .UseCommonTableForWildcard = queryProcessor .Config .UseCommonTable
663678 }
664679 }
665680 if defaultConfig .SchemaOverrides != nil {
@@ -686,6 +701,10 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
686701 if val , exists := target .properties ["useCommonTable" ]; exists {
687702 conf .CreateCommonTable = val == "true"
688703 conf .UseCommonTableForWildcard = val == "true"
704+ } else {
705+ // inherit setting from the processor level
706+ conf .CreateCommonTable = ingestProcessor .Config .UseCommonTable
707+ conf .UseCommonTableForWildcard = ingestProcessor .Config .UseCommonTable
689708 }
690709 }
691710 if ingestProcessorDefaultIndexConfig .SchemaOverrides != nil {
@@ -730,6 +749,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
730749 }
731750 if val , exists := target .properties ["useCommonTable" ]; exists {
732751 processedConfig .UseCommonTable = val == true
752+ } else {
753+ // inherit setting from the processor level
754+ processedConfig .UseCommonTable = queryProcessor .Config .UseCommonTable
733755 }
734756 if val , exists := target .properties ["tableName" ]; exists {
735757 processedConfig .Override = val .(string )
@@ -779,6 +801,9 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration {
779801 }
780802 if val , exists := target .properties ["useCommonTable" ]; exists {
781803 processedConfig .UseCommonTable = val == true
804+ } else {
805+ // inherit setting from the processor level
806+ processedConfig .UseCommonTable = ingestProcessor .Config .UseCommonTable
782807 }
783808 if val , exists := target .properties ["tableName" ]; exists {
784809 processedConfig .Override = val .(string )
0 commit comments