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

Got incorrect SQL syntax when switching to database SQL #520

Open
wwwy3y3 opened this issue Jul 16, 2024 · 1 comment
Open

Got incorrect SQL syntax when switching to database SQL #520

wwwy3y3 opened this issue Jul 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wwwy3y3
Copy link
Member

wwwy3y3 commented Jul 16, 2024

Describe the bug
Got incorrect SQL syntax when switching to database SQL

To Reproduce
Steps to reproduce the behavior:

  1. use BigQuery and ask a question
  2. click view full SQL
  3. click show original SQL
  4. copy to bigquery and run, it will fail

Expected behavior
The query should be successfully executed.

Screenshots
I use tpch data to ask a question ("list my customers") and copy the SQL from the answer:
Screenshot 2024-07-16 at 10 49 17 AM

Copy to bigquery and run:
Screenshot 2024-07-16 at 10 49 11 AM

Generated BigQuery SQL attached below:

WITH
  "customer" AS (
   SELECT
     "customer"."c_acctbal" "c_acctbal"
   , "customer"."c_address" "c_address"
   , "customer"."c_comment" "c_comment"
   , "customer"."c_custkey" "c_custkey"
   , "customer"."c_mktsegment" "c_mktsegment"
   , "customer"."c_name" "c_name"
   , "customer"."c_nationkey" "c_nationkey"
   , "customer"."c_phone" "c_phone"
   FROM
     (
      SELECT
        "customer"."c_acctbal" "c_acctbal"
      , "customer"."c_address" "c_address"
      , "customer"."c_comment" "c_comment"
      , "customer"."c_custkey" "c_custkey"
      , "customer"."c_mktsegment" "c_mktsegment"
      , "customer"."c_name" "c_name"
      , "customer"."c_nationkey" "c_nationkey"
      , "customer"."c_phone" "c_phone"
      FROM
        (
         SELECT
           "c_acctbal" "c_acctbal"
         , "c_address" "c_address"
         , "c_comment" "c_comment"
         , "c_custkey" "c_custkey"
         , "c_mktsegment" "c_mktsegment"
         , "c_name" "c_name"
         , "c_nationkey" "c_nationkey"
         , "c_phone" "c_phone"
         FROM
           "wrenai"."tpch_tiny"."customer" "customer"
      )  "customer"
   )  "customer"
) 
SELECT "c_name" "customer_name"
FROM
  "customer"

**Container Logs **
You can execute the following command to get the logs of containers and provide them here:

docker logs wrenai-wren-ui-1 >& wrenai-wren-ui.log && \
docker logs wrenai-wren-ai-service-1 >& wrenai-wren-ai-service.log && \
docker logs wrenai-wren-engine-1 >& wrenai-wren-engine.log && \
docker logs wrenai-ibis-server-1 >& wrenai-ibis-server.log

Attached privately in DM.

Desktop (please complete the following information):

  • OS: MacOSX
  • Browser: chrome

Wren AI Information

  • Version: 0.7.1
  • LLM_PROVIDER= OpenAI
  • GENERATION_MODEL= gpt4o
@grieve54706
Copy link
Contributor

@wwwy3y3, please close this fixed issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants