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

Function with name 'jsonMergePatch' does not exist #291

Open
stephencsnow opened this issue Dec 21, 2024 · 0 comments
Open

Function with name 'jsonMergePatch' does not exist #291

stephencsnow opened this issue Dec 21, 2024 · 0 comments

Comments

@stephencsnow
Copy link

Describe what's wrong

Neither jsonMergePatch nor JSONMergePatch is available since chdb 2.1.0.

Does it reproduce on the most recent release?

Yes - tested on 2.2.0b1

Enable crash reporting

N/A

How to reproduce

On my Mac, fresh virtualenv:

$ pip install chdb
$ python -m chdb "SELECT EXISTS(SELECT * from system.functions where name in ('JSONMergePatch', 'jsonMergePatch'))"
0

Expected behavior

Both jsonMergePatch and its alias JSONMergePatch should be available.

In 2.0.4:

$ python -m chdb "SELECT EXISTS(SELECT * from system.functions where name in ('JSONMergePatch', 'jsonMergePatch'))"
1

Error message and/or stacktrace

Further testing, just to confirm that it isn't just a system.functions issue.

$ python -m chdb "SELECT jsonMergePatch('{}', '{}') AS res"
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__main__.py", line 35, in <module>
    main()
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__main__.py", line 23, in main
    res = query(sql, output_format)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__init__.py", line 78, in query
    raise ChdbError(res.error_message())
chdb.__init__.ChdbError: Code: 46. DB::Exception: Function with name 'jsonMergePatch' does not exist. In scope SELECT jsonMergePatch('{}', '{}') AS res. (UNKNOWN_FUNCTION)
$ python -m chdb "SELECT JSONMergePatch('{}', '{}') AS res"
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__main__.py", line 35, in <module>
    main()
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__main__.py", line 23, in main
    res = query(sql, output_format)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssnow/.pyenv/versions/chdb/lib/python3.12/site-packages/chdb/__init__.py", line 78, in query
    raise ChdbError(res.error_message())
chdb.__init__.ChdbError: Code: 46. DB::Exception: Function with name 'JSONMergePatch' does not exist. In scope SELECT JSONMergePatch('{}', '{}') AS res. (UNKNOWN_FUNCTION)

Additional context

This works in 1.x, and 2.x versions up to 2.0.4, and fails starting in 2.1.0 onwards.

From 2.1.0 changelog:

Update ClickHouse engine to v24.8.4.13-lts

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

No branches or pull requests

1 participant