From 17d27e7ee1b560d393e7467e00818121250f7370 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Tue, 3 Oct 2023 18:52:28 +0100 Subject: [PATCH] Don't limit virtual column output types 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. --- lib/panoramix/query.ex | 7 +------ test/panoramix_test.exs | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/panoramix/query.ex b/lib/panoramix/query.ex index c0c8123..5aab6a3 100644 --- a/lib/panoramix/query.ex +++ b/lib/panoramix/query.ex @@ -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", diff --git a/test/panoramix_test.exs b/test/panoramix_test.exs index 399186a..e1f9e0a 100644 --- a/test/panoramix_test.exs +++ b/test/panoramix_test.exs @@ -906,7 +906,7 @@ defmodule PanoramixTest do "name" => "plus_one", "type" => "expression", "expression" => "foo + 1", - "outputType" => "LONG" + "outputType" => "long" } ], "aggregations" => [