Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fixes and add support for boolean inputs to classic long dimension indexer #14069

Conversation

clintropolis
Copy link
Member

Description

LONG is currently the (semi?) official boolean type in Druid, even more-so if druid.expressions.useStrictBooleans is 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 the LongDimensionIndexer does 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:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

…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
@clintropolis clintropolis merged commit 9ed8bec into apache:master Apr 12, 2023
@clintropolis clintropolis deleted the support-boolean-types-long-indexer-and-fix-sampler-auto-schema-response branch April 12, 2023 03:49
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants