Hacker News new | ask | show | jobs
by jarulraj 998 days ago
Nice writeup! Here is another example of using LLMs is to augmenting existing software that we are exploring -- specifically SQL database systems. We are using LLMs inside a SQL query to power a "soft join" between SQL tables for when a correspondence is only implied (e.g. different address formats, etc.).

   --- Create a reference table that maps neighborhoods to zipcodes using ChatGPT
   CREATE TABLE reference_table AS
   SELECT parkname, parktype, 
          ChatGPT(
          "Return the San Francisco neighborhood name when provided with a zipcode. The 
   possible neighborhoods are: {neighbourhoods_str}. The response should an item from the 
   provided list. Do not add any more words.",
       zipcode) 
   FROM postgres_db.recreational_park_dataset;


   --- Map Airbnb listings to park
   SELECT airbnb_listing.neighbourhood
   FROM postgres_db.airbnb_listing
     JOIN reference_table ON airbnb_listing.neighbourhood = reference_table.response;
More details on LLM-powered joins and EvaDB: https://medium.com/evadb-blog/augmenting-postgresql-with-ai-..., https://github.com/georgia-tech-db/evadb