Skip to content

Commit

Permalink
Don't limit virtual column output types
Browse files Browse the repository at this point in the history
As of Druid 24.0.0, virtual columns are no longer restricted to LONG,
FLOAT, DOUBLE and STRING.

Also don't upcase the type name. For simple type names, Druid does
that for us, and for complex type names, it's not necessarily
appropriate.
  • Loading branch information
legoscia committed Oct 4, 2023
1 parent 0705180 commit 17d27e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/panoramix/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,7 @@ defmodule Panoramix.Query do
expression: expression,
output_type: output_type
] do
output_type = String.upcase(String.Chars.to_string(output_type))

unless output_type in ["LONG", "FLOAT", "DOUBLE", "STRING"] do
raise ArgumentError,
"Unexpected output type #{output_type}, expected one of :long, :float, :double, :string"
end
output_type = String.Chars.to_string(output_type)

%{
"type" => "expression",
Expand Down
2 changes: 1 addition & 1 deletion test/panoramix_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ defmodule PanoramixTest do
"name" => "plus_one",
"type" => "expression",
"expression" => "foo + 1",
"outputType" => "LONG"
"outputType" => "long"
}
],
"aggregations" => [
Expand Down

0 comments on commit 17d27e7

Please sign in to comment.