bug fixes and add support for boolean inputs to classic long dimension indexer#14069
Merged
clintropolis merged 1 commit intoapache:masterfrom Apr 12, 2023
Conversation
…n indexer changes: * adds support for boolean inputs to the classic long dimension indexer, which plays nice with LONG being the semi official boolean type in Druid, and even nicer when druid.expressions.useStrictBooleans is set to true, since the sampler when using the new 'auto' schema when 'useSchemaDiscovery' is specified on the dimensions spec will call the type out as LONG * fix bugs with sampler response and new schema discovery stuff incorrectly using classic 'json' type for the logical schema instead of the new 'auto' type
imply-cheddar
approved these changes
Apr 11, 2023
clintropolis
added a commit
to clintropolis/druid
that referenced
this pull request
Apr 13, 2023
…n indexer (apache#14069) changes: * adds support for boolean inputs to the classic long dimension indexer, which plays nice with LONG being the semi official boolean type in Druid, and even nicer when druid.expressions.useStrictBooleans is set to true, since the sampler when using the new 'auto' schema when 'useSchemaDiscovery' is specified on the dimensions spec will call the type out as LONG * fix bugs with sampler response and new schema discovery stuff incorrectly using classic 'json' type for the logical schema instead of the new 'auto' type
clintropolis
added a commit
that referenced
this pull request
Apr 13, 2023
…n indexer (#14069) (#14078) changes: * adds support for boolean inputs to the classic long dimension indexer, which plays nice with LONG being the semi official boolean type in Druid, and even nicer when druid.expressions.useStrictBooleans is set to true, since the sampler when using the new 'auto' schema when 'useSchemaDiscovery' is specified on the dimensions spec will call the type out as LONG * fix bugs with sampler response and new schema discovery stuff incorrectly using classic 'json' type for the logical schema instead of the new 'auto' type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
LONGis currently the (semi?) official boolean type in Druid, even more-so ifdruid.expressions.useStrictBooleansis set to true (which it is not in the code, but is defined as true in the distribution default runtime.properties for new installs to use the better behavior). However, ingesting boolean data with the 'long' dimension schema currently fails since theLongDimensionIndexerdoes not expect to handle this type of input. As a workaround one can currently use an expression transform to coerce the boolean to a long (if strict booleans is enabled), but that's sort of sad. This PR fixes this by adding support to coercing booleans to longs using the same functions as the expressions.This PR also fixes some bugs with the sampler response after #14014, where the 'logical' dimensions list was still specifying 'json' instead of the newer 'auto' schema.
Release note
The native ingestion
"long"dimension schema can now handle boolean inputs, which will be coerced to 1L or 0L for true or false values respectively.This PR has: