Validation failed: Query failed: ERROR: function pg_catalog.date_part(unknown, text) does not exist

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

Trying to go thru Python and Dataiku DSS tutorial, Sessionization in SQL, Hive, Pig and Python, I get the following error

Validation failed: Query failed: ERROR: function pg_catalog.date_part(unknown, text) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 19

when validating the sql query

SELECT *
      ,  extract(epoch from mytimestamp)
         - lag(extract(epoch from mytimestamp))
         over (PARTITION BY user_id order by mytimestamp) as time_interval
FROM toy_data_psql;

Tagged:

Best Answer

  • Sean
    Sean Dataiker, Alpha Tester, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer Posts: 168 Dataiker
    Answer ✓

    Hi @Herve
    , I believe the issue is the storage type of the ``mytimestamp`` column. It should be in a Date format as opposed to string. We'll be improving our instructions for this tutorial to make this a little clearer.

Answers

Setup Info
    Tags
      Help me…