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

Casting from Variant into Other types. #4777

Closed
BohuTANG opened this issue Apr 9, 2022 · 3 comments · Fixed by #4787 or #4793
Closed

Casting from Variant into Other types. #4777

BohuTANG opened this issue Apr 9, 2022 · 3 comments · Fixed by #4787 or #4793
Assignees
Labels
A-query Area: databend query C-feature Category: feature

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Apr 9, 2022

Summary

Table:

 CREATE TABLE `json_test` (
  `a` Variant,
)


insert into json_test values('{"aa":1,"aA":2,"Aa":3}');

Query:

select sum(get(a, 'aa'))  from json_test;

Error:

AggregateSumFunction does not support type 'Variant' (while in select group by)
@BohuTANG BohuTANG added C-feature Category: feature A-query Area: databend query labels Apr 9, 2022
@sundy-li
Copy link
Member

sundy-li commented Apr 9, 2022

You can use cast function to apply sum.

select sum(get(a, 'aa')::UInt64)  from json_test;

@BohuTANG
Copy link
Member Author

BohuTANG commented Apr 9, 2022

mysql> select sum(get(a, 'aa')::UInt64)  from json_test;
ERROR 1105 (HY000): Code: 1002, displayText = Not yet implemented: Casting from Extension("Variant", LargeBinary, None) to UInt64 not supported (while in processor thread 35).

@sundy-li
Copy link
Member

sundy-li commented Apr 9, 2022

Ok, then let's fix this bug: casting from Variant into Other types.

@sundy-li sundy-li changed the title AggregateSumFunction type 'Variant' Casting from Variant into Other types. Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query C-feature Category: feature
Projects
None yet
3 participants