Replies: 3 comments 2 replies
-
To address case sensitivity issues in the SQL query engine when using the Here is an example of how you can modify your SQL query to be case-insensitive: # Example SQL query with case-insensitive WHERE condition
sql_query = """
SELECT * FROM your_table
WHERE LOWER(your_column) = LOWER('your_value')
""" In the context of using the For a practical implementation, you can refer to the SQL Auto Vector Query Engine tutorial provided by LlamaIndex [1]. |
Beta Was this translation helpful? Give feedback.
-
@dosu I have encountered a similar problem with SQL and pandas query pipelines due to case sensitivity. For instance, if I query for This issue becomes particularly challenging when deploying applications to end users who may not be fully aware of how values are stored in the structured database. While this approach works well with unstructured data like PDFs, it is cumbersome when dealing with structured databases using SQL or pandas. Any advice on how to make this process more user-friendly would be greatly appreciated. Thank you!" |
Beta Was this translation helpful? Give feedback.
-
@dosu This is not clear. I am using pandas query engine https://docs.llamaindex.ai/en/stable/examples/query_engine/pandas_query_engine/ I am encountering an issue with case sensitivity in the query_engine.query function. For example, if my CSV column "fruit" contains the value "Apple" and I query for all fruits like "apple," the pandas query engine returns zero rows. Because human asked 'apple' but dataframe has 'Apple'... so LLM or pandas query found zero rows. How can I resolve this? I understand that the pandas query engine operates based on pandas syntax, and I am aware that pandas is case-sensitive. Is it possible to vectorize the data within the pandas DataFrame and perform a case-insensitive query? I am open to any suggestions. I have tried to ignore case sensitivity using pandas instructions, but it is not working. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
-
In SQL query engine, I have to call exactly same field name in the where condtion. It is painful to know how the data is in the database fields for every field. Is there way I can mitigate? Thank you.
https://docs.llamaindex.ai/en/latest/examples/query_engine/SQLAutoVectorQueryEngine/
Beta Was this translation helpful? Give feedback.
All reactions