Skip to content

Re-digest predicates from DB #295

Open

Description

@yilinxia

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

Activity

  1. EvgSkv commented on Oct 14, 2023

    @EvgSkv
    Owner

    @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?

  2. yilinxia commented on Oct 16, 2023

    @yilinxia
    ContributorAuthor

    @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

  3. EvgSkv commented on Oct 17, 2023

    @EvgSkv
    Owner

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

  4. yilinxia commented on Oct 17, 2023

    @yilinxia
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions