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

Improve tutorial #39

Open
EvgSkv opened this issue Apr 17, 2021 · 14 comments
Open

Improve tutorial #39

EvgSkv opened this issue Apr 17, 2021 · 14 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@EvgSkv
Copy link
Owner

EvgSkv commented Apr 17, 2021

I am very curious about experience of newcomers with the tutorial. I am sure it can be improved to make onboarding easier.

@EvgSkv EvgSkv added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers labels Apr 17, 2021
@TimKam
Copy link

TimKam commented Apr 22, 2021

Is it possible to write Python extensions for Logica?
For example, can one define a Python function in a Colab/Jupyter notebook and then specify an interface to make this function accessible in Logica?

@EvgSkv
Copy link
Owner Author

EvgSkv commented Apr 22, 2021

@TimKam, this functionality is not exposed now, but this is something that is natural to add.

It would be quite easy to add annotation-plug-ins. For example we can let a user write a function that renders a result of a predicate as a graph. Then they could write a program

G("a", "b");
G("b", "c");
G("c", "d");
G("d", "a");
G("d", "e");

@RenderGraph(G, "/path/to/graph.html");

And when this program runs the HTML file has rendering of the graph a - b - c - d - a, d - e.

I think it's much more tricky to add ability to call python functions from Logica. Like the user defining:

def F(x):
  return 2 * x;

and then having Logica program

Q(F(5));

resulting in Q having a row col0: 10
This is because Logica's engine is a database and BigQuery surely doesn't have python support, I am not sure about psql.

Could you tell a little bit about usecase that you had in mind?

@TimKam
Copy link

TimKam commented Apr 22, 2021

Thank you for the prompt response. In my particular case I want to take a directed graph, process it in Python and return the result back to Logica. I am not sure if this is your "easy" or "tricky" case: in your "easy" case, could one write the result back to Logica? Edit: Should we move to a new ticket?

@EvgSkv
Copy link
Owner Author

EvgSkv commented Apr 23, 2021

We should have started the discussion in a separated ticket or in a discussion section :-) But as it's already going here, let's get to the bottom of it and then create an appropriate issue.

This seems somewhere in the middle between "easy" and "tricky".
Should the input of your function be coming from Logica, or from outside?

@TimKam
Copy link

TimKam commented Apr 23, 2021

The input should also come from Logica. So it would be Logica -> Python (for example) -> Logica.

@EvgSkv
Copy link
Owner Author

EvgSkv commented Apr 23, 2021

@TimKam, I've created an issue #55 for this. Please take a look and let me know what you think about it.

@atqnp
Copy link

atqnp commented Jun 6, 2021

@EvgSkv
Thank you very much for your work!
Sorry if these already been explained in the tutorial.
I wanted to ask about some of my use case and I think it should also be included here so it may be added in future tutorial. For now only these came to mind.

  1. Filtering boolean column. I am unable to filter a column of true or false. How do I write to filter a column with boolean data?
  2. LIKE - How do I write to filter only a part of known string in SQL?

@EvgSkv
Copy link
Owner Author

EvgSkv commented Jun 7, 2021

@atqnp
Thank you for supportive feedback and questions!
I've updated tutorial with the answers.
Let me know if further clarification is needed.

@evelynmitchell
Copy link

You use Z in the tutorial in what feels to me like a confusing way.

It is first introduced as an alias for the Integers, and then is re-introduced as a subset of the integers.

But Z is not a builtin equivalent to the Integers, it's just a variable name.

@evelynmitchell
Copy link

The colab notebooks assumes you have access to a BigQuery project "YOUR_PROJECT":
BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/YOUR_PROJECT/jobs: Invalid project ID 'YOUR_PROJECT'. Project IDs must contain 6-63 lowercase letters, digits, or dashes. Some project IDs also include domain name separated by a colon. IDs must start with a letter and may not end with a dash.

What would be a better default name, for someone who doesn't normally run BigQuery out of colab?

@evelynmitchell
Copy link

evelynmitchell commented Jun 25, 2021

Typo
querries should be queries.
Inifinite should be Infinite

@EvgSkv
Copy link
Owner Author

EvgSkv commented Jun 29, 2021

@evelynmitchell Thanks for feedback! I agree with these comments and is thinking how to address them.

What would be a better default name, for someone who doesn't normally run BigQuery out of colab?
You need your own GCloud project to run BigQuery query. However Logica can run on SQLite, so I plan to adjust tutorial to leverage that and make it easier for users who don't have a GCloud project.

@EvgSkv EvgSkv removed the good first issue Good for newcomers label Dec 20, 2021
@egreglee
Copy link

What would be a better default name, for someone who doesn't normally run BigQuery out of colab? You need your own GCloud project to run BigQuery query.

Simpler might be to add this to the tutorial:
If you do not have a project yet you can [create it here (https://console.cloud.google.com/projectcreate).

The intros suggest starting with the tutorial, but I was quite stuck getting the tutorial to run until I stumbled on this fragment in the Hello World example.

@emiruz
Copy link

emiruz commented Dec 17, 2022

I'm very much sold on the benefits of Logica for managing large amount of SQL. Its important to note that you have an especially compelling use case when the data is modelled in a star schema because the amount of re-use potential across queries ends up being huge.

I think people coming from SQL will want to see like for like comparisons. Things like GROUP BY are mostly implicitly explained, but how do I do a LEFT JOIN? Is there an equivalent of the HAVING keyword? And so on.

I think this is quite a nice approach that could work well here too:

https://mercury-in.space/crash.html

EvgSkv pushed a commit that referenced this issue Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants