Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chdb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} -DENABLE_THINLTO=0 -DENABLE_TESTS=0
-DENABLE_SIMDJSON=1 -DENABLE_RAPIDJSON=1 \
${CPU_FEATURES} \
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
-DENABLE_BASE64=1 \
-DENABLE_LIBFIU=1 \
-DCHDB_VERSION=${CHDB_VERSION} \
"
Expand Down
1 change: 1 addition & 0 deletions chdb/build/build_static_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} -DENABLE_THINLTO=0 -DENABLE_TESTS=0
-DENABLE_SIMDJSON=1 -DENABLE_RAPIDJSON=1 \
${CPU_FEATURES} \
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
-DENABLE_BASE64=1 \
-DENABLE_LIBFIU=1 \
-DCHDB_VERSION=${CHDB_VERSION} \
"
Expand Down
1 change: 1 addition & 0 deletions chdb/build/build_static_lib_mac_on_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} \
-DENABLE_SIMDJSON=1 -DENABLE_RAPIDJSON=1 \
${CPU_FEATURES} \
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
-DENABLE_BASE64=1 \
-DENABLE_LIBFIU=1 \
-DCHDB_VERSION=${CHDB_VERSION} \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
Expand Down
1 change: 1 addition & 0 deletions chdb/build_mac_on_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${build_type} \
-DENABLE_SIMDJSON=1 -DENABLE_RAPIDJSON=1 \
${CPU_FEATURES} \
-DENABLE_AVX512=0 -DENABLE_AVX512_VBMI=0 \
-DENABLE_BASE64=1 \
-DENABLE_LIBFIU=1 \
-DCHDB_VERSION=${CHDB_VERSION} \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
Expand Down
2 changes: 1 addition & 1 deletion datastore/tests/test_json_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def test_json_extract_array_raw_nested_path(self, ds_json_arrays):
)
ds = DataStore.from_df(df)
ds['hobbies'] = ds['data'].json.json_extract_array_raw('user.hobbies')
result = ds.to_df()
result = ds.to_df().sort_values('id')

assert isinstance(result['hobbies'].iloc[0], list)
assert result['hobbies'].iloc[0] == ['reading', 'coding']
Expand Down
24 changes: 24 additions & 0 deletions tests/test_base64.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!python3

import unittest
import chdb


class TestBase64Functions(unittest.TestCase):
"""Test ClickHouse base64Encode and base64Decode functions."""

def test_base64_encode(self):
res = chdb.query("SELECT base64Encode('clickhouse')", "CSV")
self.assertEqual(res.bytes().strip(), b'"Y2xpY2tob3VzZQ=="')

def test_base64_decode(self):
res = chdb.query("SELECT base64Decode('Y2xpY2tob3VzZQ==')", "CSV")
self.assertEqual(res.bytes().strip(), b'"clickhouse"')

def test_base64_roundtrip(self):
res = chdb.query("SELECT base64Decode(base64Encode('hello world'))", "CSV")
self.assertEqual(res.bytes().strip(), b'"hello world"')


if __name__ == "__main__":
unittest.main()