Skip to content

Commit 11a3e57

Browse files
authored
Merge pull request #524 from EvgSkv/main
Catch up ti2023.
2 parents 3c75eea + 42f2208 commit 11a3e57

7 files changed

Lines changed: 679 additions & 62 deletions

File tree

.github/scripts/setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
long_description_content_type = "text/markdown",
3434
url="https://github.com/evgskv/logica",
3535
packages=setuptools.find_namespace_packages(),
36+
package_data={
37+
# The release script clones the repo into a `logica/` folder and builds a
38+
# namespace package, so this package is named `logica.parser_cpp`.
39+
# Ship the C++ source so the runtime bridge can build liblogica_parse_cpp.so.
40+
'logica.parser_cpp': ['logica_parse.cpp'],
41+
},
3642
classifiers = [
3743
"Topic :: Database",
3844
"License :: OSI Approved :: Apache Software License"

colab_logica.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,3 +551,11 @@ def PostgresJumpStart():
551551
print('Installation succeeded. Connecting...')
552552
# Connect to the database.
553553
ConnectToLocalPostgres()
554+
555+
556+
def UseCppParser():
557+
os.environ['LOGICA_PARSER'] = 'CPP'
558+
from .parser_cpp import logica_parse_cpp # type: ignore
559+
so_path = logica_parse_cpp.EnsureCppParserSharedObject()
560+
logica_parse_cpp.LoadCppParserLib()
561+
return so_path

integration_tests/duckdb_json_test.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Data() = Join(['{"a": 1, "b": [1,2]', ' "c": {"d": "A", "e": [1,2,3]}}'], ",");
1717
Data() = '{"a": 2, "b": [3,4], "c": {"d": "B", "e": [4,5,6]}}';
1818

19-
Test(a: record.a, e_element: x, record:) order_by("record") :-
19+
Test(a: record.a, e_element: x, record:) order_by("record", "e_element") :-
2020
d = Data(),
2121
record = Cast(d, {a: Num, b: [Num], c: {d: Str, e: [Num]}}),
2222
x in record.c.e;

0 commit comments

Comments
 (0)