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

Re-digest predicates from DB #295

Open
yilinxia opened this issue Oct 13, 2023 · 4 comments
Open

Re-digest predicates from DB #295

yilinxia opened this issue Oct 13, 2023 · 4 comments

Comments

@yilinxia
Copy link

I tried to pass one predicate to another with the following scripts on local PC

%%logica Child

@Engine("sqlite");

@AttachDatabase("mydata", "my_database.db");
@Dataset("ParentTable");

Parent(..r) :- mydata.ParentTable(..r);

Child(x):- Parent(child:x);

The Child table is supposed to be created successfully, but I encountered the error below

Running predicate: Child
--- SQL ---
SELECT
  JSON_EXTRACT(mydata_ParentTable, "$.child") AS col0
FROM
  mydata.ParentTable AS mydata_ParentTable
[ Error ] Error while executing SQL:
Execution failed on sql 'SELECT
  JSON_EXTRACT(mydata_ParentTable, "$.child") AS col0
FROM
  mydata.ParentTable AS mydata_ParentTable': no such column: mydata_ParentTable
@EvgSkv
Copy link
Owner

EvgSkv commented Oct 14, 2023

@yilinxia I've tried in my colab and it worked:
https://colab.research.google.com/drive/1n8TG1THH6nr0aCyHx-GAIx4r7pVnXLcb?usp=sharing

Can you please take a look and see what's the difference?

@yilinxia
Copy link
Author

@EvgSkv I compared the SQL in Colab and Jupyter

Colab

SELECT
  JSON_EXTRACT(JSON_OBJECT('child', mydata_ParentTable.child), "$.child") AS col0
FROM
  mydata.ParentTable AS mydata_ParentTable;

JupyterLab

SELECT
  JSON_EXTRACT(mydata_ParentTable, "$.child") AS col0
FROM
  mydata.ParentTable AS mydata_ParentTable

somehow they are different, although we are using the same script

@EvgSkv
Copy link
Owner

EvgSkv commented Oct 17, 2023

Maybe this was fixed after you installed logica? Can you please try upgrading to the latest version and seeing if it helps?

@yilinxia
Copy link
Author

the update works! and the one i used is version: 1.3.1415926

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

2 participants