Query error on dimensions declared as NUMBER type
Declaring a dimension to be a number within the pivot configuration file like so:
- name: applicationId title: Application Id type: NUMBER
leads to the following exception message
Query error - numberBucket must have input of type NUMBER or NUMBER_RANGE (is STRING)
The dimension is in deed a string dimension (we are running Druid 0.9.0 which only supports string dimensions internally) but the contents are integers. Declaring dimensions as numbers worked on older Pivot versions but is broken in 0.8.42 (or before), probably because the addition of the numberBucket function is now automatically added.
So this issue might be twofold
- numberBucket should work with string dimensions declared as type number
- numberBucket shouldn't be automatically added just because a dimension is a number or there would need to be a way to disable this explicitly in cases when bucketizing is not desired.
Hi Sascha, Do you have an entry for that dimension being a number in both the attributeOverrides section and the dimensions section? Good point about being to explicitly disable bucketing
Just an update on this -- we're planning on adding the option of indicating a numeric dimension isn't bucketable and later adding more possible configurations.
In terms of the query error, could you let me know if it happens with both entries in the config? Thanks a lot!
Hi Sascha, In 0.9.27 you can indicate a bucketing strategy for a dimension in the config. bucketingStrategy: neverBucket would turn off bucketing for that dimension. Please let us know if you're still seeing the query error issue, thanks!
Hi Eva, sorry for coming back to you so late.
Interesting results:
- bucketingStrategy: works on our end and if I use it as part of the dimension declaration section, when splitting on a field that has this declaration will cause the bar-chart view to show, rather than the table view.
- using a NUMBER type definition in the attributeOverrides and NOT repeating the type definition in the dimensions section works and will pull up the table view when making a split on that field
- using a NUMBER type definition in the attributeOverrides section AND in the dimension section for the respective field works and will pull up the bar-chart view when making a split on that field
Thanks a lot for your effort. Don't know if the behaviour concerning the bar-chart vs. table view is according to your expectation. Ultimately it would probably be best to make this an explicit config rather than having to implicitly model this by user one way of configuring stuff over another, but for now its really nice that both behaviours can be had.
Hi Sascha! We are working on fleshing out visualization picking behavior in general
One more thing: what I missed in my last tests where query-time-lookups. I now noticed that when a dimension is declared to be a number and works in Pivot as a dimension because the bucketingStrategy is set to neverBucket, it is nonetheless the case that QTL lookups on that dimension fail with the excption "lookups must have input of type stringor SET/STRINGS (is NUMBER)