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

[CH-402]Enable return null and complex type for get_json_object function #403

Merged

Conversation

KevinyhZou
Copy link

@KevinyhZou KevinyhZou commented Apr 6, 2023

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Enable return null and complex type for get_json_object function. By adapt to 2 settings function_json_value_return_type_allow_nullable and function_json_value_return_type_allow_complex as introduced in pr : ClickHouse#47494. The issue is described in #402

@kyligence-git
Copy link
Collaborator

Can one of the admins verify this patch?

@KevinyhZou KevinyhZou changed the title Enable return null and complex type for get_json_object function [CH-402]Enable return null and complex type for get_json_object function Apr 6, 2023
if (function_name == "JSON_VALUE")
{
context->setSetting("function_json_value_return_type_allow_complex", true);
context->setSetting("function_json_value_return_type_allow_nullable", true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要在这个位置修改配置。。不可以在最开始的时候配置好吗。在解析计划的时候修改context似乎不太合理

@@ -17,7 +17,7 @@ struct NativeAllocatorContext
{
std::shared_ptr<DB::CurrentThread::QueryScope> query_scope;
std::shared_ptr<DB::ThreadStatus> thread_status;
DB::ContextPtr query_context;
DB::ContextMutablePtr query_context;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该在这里修改context

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@KevinyhZou
Copy link
Author

Fixed done @liuneng1994

@liuneng1994
Copy link
Collaborator

test this please

Copy link
Collaborator

@liuneng1994 liuneng1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liuneng1994 liuneng1994 merged commit 876a30d into Kyligence:clickhouse_backend Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants