An error occurred ERROR: permission denied for schema dku_tshirt Position: 67

Herve
Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

I get the following

An error occurred

ERROR: permission denied for schema dku_tshirt Position: 67

when trying to run

SELECT campaign, AVG(total), SUM(total), COUNT(campaign)
    FROM "dku_tshirt"."DKU_TUTORIAL_SQL_customers_enriched"
    WHERE birthdate >= '1980-01-01' AND birthdate < '1990-01-01'
    GROUP BY campaign

in the Dataiku DSS & SQL course, section Hands-On: SQL Notebooks

Best Answer

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner
    Answer ✓

    My bad !!! column was renamed in my dataset, oops

    Using birthdate_parsed works much better

    Thanks for the repplies.

Answers

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

    Please note, other SQL Queries run from the DSS recipes work just fine

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

    Previous step in the section worked too

    SELECT * FROM "DKU_TUTORIAL_SQL_customers_enriched"

  • tgb417
    tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,601 Neuron
    edited July 17

    @Herve
    ,

    You might try dropping the reference to the schema in your SQL.

    SELECT campaign, AVG(total), SUM(total), COUNT(campaign)
        FROM "DKU_TUTORIAL_SQL_customers_enriched"
        WHERE birthdate >= '1980-01-01' AND birthdate < '1990-01-01'
        GROUP BY campaign

    Note I dropped:

    "dku_tshirt".

    From the query above.

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

    I tried it

    SELECT campaign, AVG(total), SUM(total), COUNT(campaign)
    FROM "DKU_TUTORIAL_SQL_customers_enriched"
    WHERE birthdate >= '1980-01-01' AND birthdate < '1990-01-01'
    GROUP BY campaign

    gives me another error :

    An error occurred

    ERROR: column "birthdate" does not exist Position: 115

  • MopeA
    MopeA Alpha Tester, Dataiker Alumni, Registered Posts: 9 ✭✭✭✭✭
    edited July 17

    Hi, you mentioned that the previous step in the instructions worked when you dropped the reference to the schema:

    SELECT * FROM "DKU_TUTORIAL_SQL_customers_enriched"

    When you ran this step, were you able to see a preview of the table at the bottom of the code editor? It should show you if the "birthdate" column is in the table. If the column is missing, it might be that you didn't select this column when you used the Join recipe to create the customers_enriched dataset.

    Also, you don't have permissions on the "dku_tshirt" schema, probably because you didn't create it. You can follow these instructions from the Integration with SQL databases course to create the schema, and then you should be able to use the code snippets in the tutorial without having to drop the reference to the schema.

    Hopefully, this helps. Please let us know.

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

    When I run

    SELECT * FROM "DKU_TUTORIAL_SQL_customers_enriched"

    I get the table

    dss sql.png

  • Herve
    Herve Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 58 Partner

    I also did everything listed on https://academy.dataiku.com/integration-with-sql-databases-1/500810

    Wouldn't the "PostgreSQL connection" fail the test otherwise (from DSS settings) ?

Setup Info
    Tags
      Help me…