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

Multi-predicate query #1085

Closed
1 of 2 tasks
jarulraj opened this issue Sep 10, 2023 · 8 comments · Fixed by #1088
Closed
1 of 2 tasks

Multi-predicate query #1085

jarulraj opened this issue Sep 10, 2023 · 8 comments · Fixed by #1088
Assignees
Labels
Bug 🐞 EVA is not working as expected

Comments

@jarulraj
Copy link
Member

Search before asking

  • I have searched the EvaDB issues and found no similar bug report.

Bug

SELECT _row_id, name, bio
FROM CommunityCSV
WHERE _row_id < 100 AND
ChatGPT("Is this user interested in database? Return only Yes or No.", scraped_data) = "Yes"
AND followers > 50;

Merging of DataFrames with unmatched indices can cause undefined behavior

Environment

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@jarulraj jarulraj added the Bug 🐞 EVA is not working as expected label Sep 10, 2023
@github-actions
Copy link
Contributor

👋 Hello @jarulraj, thanks for your interest in EVA DB 🙏 Please visit our 🔮 Tutorials to get started, where you can find quickstart guides for simple tasks like Image Classification all the way to more interesting tasks like Emotion Analysis.

If this is a 🐞 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a ❓ Question, please provide as much information as possible, including dataset examples and query results.

@jarulraj
Copy link
Member Author

SELECT * for CSV

  communitycsv.id                                 communitycsv.repos
0         10535731                                               None
1         43614147                                               None
2         42648713                                               None
3          5212023                                               None
4         15823053                                               None
5         10338424                                               None
6          7430969  MyMEngSeminarFiles, MyPythonCodes, PracticalMa...
7          5708290  MyMEngSeminarFiles, MyPythonCodes, PracticalMa...
8         16434853  MyMEngSeminarFiles, MyPythonCodes, PracticalMa...

@jarulraj
Copy link
Member Author

CREATE FUNCTION IF NOT EXISTS -- when the function exists and we run the script again, this query throws an error saying that the function already exists.

@jarulraj
Copy link
Member Author

eva.csv

@jarulraj
Copy link
Member Author


        cursor.query(f"DROP TABLE IF EXISTS CommunityCSV;").df()

        cursor.query(f"""CREATE TABLE CommunityCSV(
            name TEXT(1000),
            login TEXT(1000),
            following INTEGER,
            followers INTEGER,
            email TEXT(1000),
            id INTEGER,
            location TEXT(1000),
            bio TEXT(1000),
            company TEXT(1000),
            blog TEXT(1000),
            url TEXT(1000),
            twitter_username TEXT(1000),
            repos TEXT(1000),
            scraped_data TEXT(10000));""").df()

        cursor.query(f"LOAD CSV '{DEFAULT_CSV_PATH}' INTO CommunityCSV;").df()

        pd.set_option('display.max_columns', None)  # Show all columns
        pd.set_option('display.expand_frame_repr', False)
        pd.set_option('display.max_colwidth', None)

        # execute a select query
        select_query = cursor.query(
            """SELECT _row_id, name, bio
                    FROM CommunityCSV
                    WHERE _row_id < 100 AND ChatGPT("Is this user interested in database? Return only Yes or No.", scraped_data) = "Yes" AND followers > 50;
            """).df()

        print(select_query)

@xzdandy
Copy link
Collaborator

xzdandy commented Sep 10, 2023

CREATE FUNCTION IF NOT EXISTS -- when the function exists and we run the script again, this query throws an error saying that the function already exists.

Can not reproduce this error. Could you share the full query? Thanks!

@jiashenC
Copy link
Member

#1088

@gaurav274 gaurav274 linked a pull request Sep 11, 2023 that will close this issue
@gaurav274
Copy link
Member

#1088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 EVA is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants